5

I am starting to learn GWT.

I've picked up newest version (2.7.0).

I have wrote Entry point class to display start page and to call rpc to server to execute some function.

Every change I made in client side source code in Entry point class, cause auto recompile (hot swap), so I can see immediatly changes, that I've apply.

My problem is that it works only for client side code.

It dosen't work for server side code. To see changes in server side code, I have to stop server and console, and run it again, which is very very annoiyng.

So my question is:

  • Is it normal behaviour of gwt app server in SuperDevMode in 2.7.0 version? Or am I doing something wrong?
  • How should I deal with that?

Please give me your thougths about it.

By the way: I use GWT with eclipse and Google plugin.


EDIT

I wonder what about Maven GWT projects? How to deal with them?

masterdany88
  • 5,041
  • 11
  • 58
  • 132

3 Answers3

2

What you describe is normal behavior.

There are several ways to reload the server side code when refreshing without restarting your server:

  1. The built in web server does support hot swapping code, but only if you do not modify method or class signatures. If you do change them (or add a class or method), a server restart is required.
  2. You might need to configure your Eclipse to auto re-publish any code changes to your web server.
  3. There are 3rd Party Eclipse plugins which improve the hot code reloading mechanism, for example JRebel, which allows hot code replacement even if you change method or class signatures.
Bob
  • 5,510
  • 9
  • 48
  • 80
  • Can You give me more information about 2 solution? How to build project? How to start server? What server to use, built in Jetty or maybe Tomcat? How to configure that in eclipse? Maybe some usefull link? – masterdany88 Aug 24 '15 at 11:52
  • I'm using Tomcat and the "Servers" view (see http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.wst.server.ui.doc.user%2Ftopics%2Frwrcview.html) in Eclipse to start and stop it. There's also a "Publish" button in the "Servers" view which I use to publish the changes without a server restart. – Bob Aug 26 '15 at 08:07
  • You use `Servers` views/tab to start at first time the server instead of using `RMB -> Run as Web application(GWT Super Dev Mode)` as I understand correctly? – masterdany88 Aug 26 '15 at 12:29
  • Yes, but to start Tomcat, and not the GWT built-in Jetty server. – Bob Aug 26 '15 at 12:30
1

There's a "reload webapp" button in DevMode. It's in the "Jetty" tab when using "bare" DevMode, and a yellow double spinning arrow in the Eclipse view when using the GPE. It'll restart the web app just as if you redeployed it in a standalone server.

Thomas Broyer
  • 64,353
  • 7
  • 91
  • 164
  • I know this solution. It isn't bad. But it doesn't work automatically. I am looking for solution that will do the job for me. Also it won't work for maven gwt projects. – masterdany88 Aug 24 '15 at 06:49
  • What do you mean by "won't work for maven projects"? If you use an IDE, it'll recompile the classes on-the-fly (well, depending on the IDE) so it'll work the same. Without an IDE then yes you have to trigger a recompile, you can use file watchers for that. Alternative is to not host your server-side code in DevMode but use a servlet container that your IDE can auto-redeploy to. – Thomas Broyer Aug 24 '15 at 08:57
  • I can't set gwt maven project to work with eclipse. I don't have `run as super dev mode` option like it was with GPE. **But still it won't work automatically after server code change. I'have to do it manually.** – masterdany88 Aug 24 '15 at 11:44
0

I found this solution: https://github.com/jbarop/gwt-hotdeployment It seems to do the job for developer.

But it is quite old.

masterdany88
  • 5,041
  • 11
  • 58
  • 132