开发者

Vaadin - GWT error "module xxx may need to be recompiled

I'm ramping up on Vaadin and I'm getting this javascript alert whenever I try and run the demo apps.

GWT module 'com.vaadin.terminal.gwt.DefaultWidgetSet' may need to be recompiled

I've tried cleaning the project to no avail.

As I said, I'm ramping up so I'm sure there's some simple step I'm missing or a con开发者_如何转开发cept I haven't grasped.


I don't know anything about Vaadin, but there's a more general context in which this error occurs:

So long as you're testing in Eclipse, the dynamic coding of your app is still real Java coding being run in a JVM. This coding is made available through debugger that's accessible via a socket. You get a URL that looks like this:

http://127.0.0.1:8888/MyApp.html?gwt.codesvr=127.0.0.1:9997

with this codesvr thing being your eclipse-hosted debugger process for your Java code.

Before your app can run standalone, GWT has to translate your Java code to JavaScript; separate versions of the code are produced for each browser type (Firefox, WebKit, Opera, ...) and language that you want to support. Only once this is done can you access your app the usual way via

http://127.0.0.1:8888/MyApp.html

After weeks of running my app only in Eclipse, I'd managed to forget about the compiling-for-browsers step and wondered about the message. The way to fire up the compiler, if you're not using the Ant task, is to hit Google|GWT Compile in the project's context menu. That done, the JS in your app gets fleshed out and your app can run without Java on the client side.

And of course the message goes away.


It is a warning not an error. Does the app work? Otherwise you have to recompile the Vaadin widgetset. These might help too: http://vaadin.com/directory/help/using-vaadin-add-ons


Often this message meens:

  • you're missing the ?gwt.codesvr=127.0.0.1:9997 parameter in the URL (or have misspelled it).
  • your module uses the xs linker <add-linker name="xs" />. This is a known limitation and will be fixed in the future: Issue 4232: Allow Development Mode to work with XS Linker


You may need to clear the browser cache. It is possible that the compiled js that the browser is using is not the js that has most recently been compiled.

In Chrome you can see if the cached js is being used in the developer tools windows (ctrl + shift + i). In the size column it will say (from cache) instead of the actual size. You can then right click and clear the browser cache. ctrl + r to reload and the error should be gone.


Carl Smotricz is absolutely right.

Just Cleaning and Build Project on the topmost menu doesn't work.

You must use "Google | GWT Compile" on the context menu generated when right-clicking on your GWT project, prior to deployment. The error may not be about not-adding "?gwt.codesvr=127.0.0.1:9997" at the end of host web page if he or she tried to deploy the GWT-based webapp on WAS external to Eclipse.


Server restart did the job for me. I had tried clearing cache, clean and rebuild .. but i was still getting the same warning message. Server restart made it reload all the stull from the latest compiled war. It was a hit and trial and i am glad it worked :) :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜