2
我開始在OS X 10.5.8上使用Eclipse插件在最新的Google Web Toolkit中弄潮兒。到目前爲止,我已經能夠讓客戶端運行起來,這非常棒。GWT中拋出的NoSuchMethod異常
但是,服務器是另一回事。我試圖鏈接到一個.jar文件,該文件有一些我想在服務器ServiceImpl類中使用的類,但它似乎已經滲入到前一個.jar迭代中 - 我添加了一個方法,重新構建了jar ,從GWT項目構建路徑的庫選項卡(以及導出)中刪除了該jar,並重新引用了該jar。沒有運氣 - 我仍然得到:
[WARN] Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract org.gwtapplication.client.LWDocument org.gwtapplication.client.DocumentService.getDocument()' threw an unexpected exception: java.lang.NoSuchMethodError: org.externalmodel.MyReallyValidClass.toSomething()Ljava/lang/String;
at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:378)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:581)
...
Caused by: java.lang.NoSuchMethodError: org.externalmodel.MyReallyValidClass.toSomething()Ljava/lang/String;
at org.application.server.DocumentServiceImpl.getDocument(DocumentServiceImpl.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
Eclipse的代碼感覺沒有問題解決MyReallyValidClass.toSomething()調用,並有與其他呼叫到externalmodel類沒有錯誤。任何線索我應該看什麼?
完美!在war/WEB_INF/lib目錄中存在一個陳舊的.JAR副本。刪除它做了伎倆。謝謝! – eb1 2010-06-11 22:09:30
我有一個類似的問題,在清除'gwt-unitCache /'和'%TEMP%/ gwt *'後就消失了(參見[GWT問題](http://code.google.com/p/google-web- toolkit/issues/detail?id = 5261#c14)。 – 2012-06-25 19:07:12