Tuesday, September 7, 2010

Frequent error when developing Gwt

Deferred binding failed for …
the service interface does not extend the “RemoteService” interface.


No source code is available for type java.uitl.Calendar; did you forget to inherit a required module?
I guess the reason for this error is that GWT does not know how to convert this type into java script. In GWT module xml, there is setting for source. For example

<source path="client" />

If you have a class in that package "client" and reference to java.util.Calendar, GWT does not know how to convert that Calendar function into java script, so it gives out the Error.

If you have cleasses in GWT “client” folder and they depends on some jar files. GWT also try to convert the classes in those jar files but cannot find the source. if you do have the source code,  you can create your own gwt.xml and let GWT know where is the source code.

For example, create a file com/lalou/jonathan/MyDependedProject.gwt.xml, with as content:

<source path="">
<include name="**/MyEntity.java" />

In your *.gwt.xml, add the dependency

<inherits name='com.lalou.jonathan.MyDependedProject' />

For detail, read this article.


[ERROR] Invalid version number "2.0" passed to external.gwtOnLoad(), expected "2.1"; your hosted mode bootstrap file may be out of date; if you are using -noserver try recompiling and redeploying your app

Solution: clear the cache of the browser.

No comments:

Post a Comment