2
votes

I am newbie to GWT. I have built gwt maven project. To run in development mode, I first compiled project Google|Compile Project, then from command mvn gwt:run, it runs fine on

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

but for production I want to access module

http://localhost:8888/index.html 

When I omit gwt.codesvr= argument, I am getting error "gwt module may need to be recompiled". After Recompiling, I get the same error. Any help/pointer?

Thanks,

2
I have followed the steps mentioned in the link, but still getting the same error. Please help. - Mustansar Saeed
You might check to be sure that the module you're loading in your html file matches exactly the name of the module in your gwt.xml file. I was once in a situation where the shortname I had assigned to the module was respected in dev mode but not production - I'd forgotten to update it in some places, and dev mode was smart enough to figure it out, but production was not. - Riley Lark
I have not assigned short name to the module. gwt.xml file looks like <module><inherits name='com.monitorme.ui.Ui'/><entry-point class='com.monitorme.ui.UiStandalone' /><inherits name='com.google.gwt.user.User' /></module>, is this compilation issue or dependency issue which is not making required files? thanks - Mustansar Saeed
I'm using gwt since 2.0 now after upgrading from 2.6.0 to 2.7.0 I started to see this issue - montss

2 Answers

0
votes

i run gwt project on tomcat on production mode. Jetty cant show it. Try to tun with external web module. When you are look at the IDE console title show us 'Development Mode'. Tyr with external , in any exception i can help.

0
votes

You did it correctly, but as the error states, the module needs to be re-compiled (GWT Compiled). Once recompiled, Force your browser to reload (Ctrl + F5). If that doesn't work, you can look at this answer I wrote regarding cleanup of compiled output. Do what's listed there, and try running GWT compile again.

To run production mode outside Eclipse, you must do a GWT compile and create a WAR file, which you can then deploy on a Java application server such as Tomcat. This process is much easier with an ant build script.

To make an ant build script for your project:

You can easily create an ant build script by running the webAppCreator command from the directory where the GWT library is installed. That command will create a sample project just like clicking "New Web Application Project" in Eclipse, except it will also make a build.xml file.

You can run it in Eclipse by right clicking build.xml > Run As... > Ant build. By default it will run the build target. It also has a war target, which you can run to create a WAR file.

For more details on the webAppCreator, look here.