Sebi
Sebi

Reputation: 9033

How to debug problems with GWT dev/hosted mode?

I'm trying to set up the GWT dev/hosted mode in a Maven-based Java webapp. I start my webapp via Maven Tomcat7 plugin (mvn tomcat7:run-war-only) and it is running fine. Also, startup of GWT via mvn gwt:run works and shows no errors.

However, if I access my webapp with the gwt.codesvr=127.0.0.1:9997 parameter, I just see a blank page in my browser. Interestingly, the page source contains the content of my JSP, but it is only defining some divs to be replaced by GWT.

How do I debug this situation? I haven't found any option for GWT dev mode to generate some kind of logging output. For example, it would be interesting to know if the GWT code server ever receives a call. At the moment, I'm missing any clue where to start looking why GWT dev mode is not working.

Upvotes: 0

Views: 1061

Answers (1)

Sebi
Sebi

Reputation: 9033

My original question was, how to debug Maven GWT plugin in case it is not doing what it is supposed to do. Here are a few hints which helped me during this process:

  • increase log level to ALL via config parameter
  • check in browser (e.g. via Firebug) that files of hosted mode like devmode.js and hosted.html are queried
  • insert Window.alert("..."); into the onModuleLoad() function to see if GWT code is executed at all
  • ensure that your app server is executing the exploded war (e.g., delete packaged WAR file before starting app server)
  • after startup of app server, don't call page without GWT codeserver parameter as this already generates some GWT files in the webapp exploded folder, which might conflict with those to be created by GWT hosted mode; take note which files are created and delete them manually
  • GWT dev mode seems to be not fully deterministic as I was able to get it running after forced reloading of the page in my browser
  • start from a working example, e.g. like the one I shared here: https://github.com/steinsag/gwt-maven-example

Upvotes: 2

Related Questions