MattWeiler
MattWeiler

Reputation: 790

Debugging GWT Client in Eclipse while running on Tomcat (multiple WARs)

I've recently started a new job wherein I have to fix bugs with and make additions to a suite of GWT applications which have had a lot of contributors/developers of the years :(

App Server: Tomcat 6.0.16
JRE:        Java 6
GWT:        2.5.0
Eclipse:    Juno

The strange thing about this configuration is that for each application in the suite (there's about 4) the client-side code is separated into it's own war file and the server-side code is separated into several war files. The problem is that the various components (war files) have reliance's on one another and interact during runtime.


Request

Basically, I have gotten server-side debugging working but I would like to get client-side debugging working via Eclipse; so far I haven't been able to.


Code Layout

When the code is fully deployed to Tomcat, it looks like this:


Past Experiences

At my last job my team was the only team developing using GWT and Maven. We were able to design and implement the applications and thus we kept things simple.

For each application, we kept all of the client & server code in 1 WAR file.

All shared components that we created (window management system, etc...) were JAR'd up and included in each applications WAR file.

Doing things this way made for a very simple debug setup; we were able to debug both the client & server code using Eclipse while running the applications in Tomcat or Weblogic.

Upvotes: 2

Views: 1908

Answers (1)

Ümit
Ümit

Reputation: 17489

There is a setting which allows you to start the GWT dev mode with an external server. See here for more details. Basically you do following things:

  1. Start your App server in debug or run mode (depending if you want to also debug your backend code in eclipse).
  2. Start GWT dev mode with the -noserver option (which won't start the embedded jetty container).
  3. Go to the URL that is served by your app server (i.e. http://localhost:8080/index.jsp?gwt.codesvr=localhost:9997)

If you use maven you can run the dev mode with following command : mvn gwt:run -Dgwt.noserver=true

Upvotes: 1

Related Questions