First off, I am deploying the application in a local tomcat, so I need to be able to debug what eclipse considers an external server ( as opposed to having eclipse / gwt spin up a server within eclipse ). A quick google search for the keywords of interest brings up as the first result a very helpful stackoverflow answer:
Simple, right? Sadly step 2 did nothing for me. I select it, and nothing happens. So what I ended up doing was to set up my own debug configurations. When I did this, I kept getting this annoying error:
Working directory does not exist: /Users/myStuff/Documents/workspace/myProject-TRUNK/webapp/helloWorld/target/helloWorld-webapp-1.7-MS2.01-SNAPSHOT
I thought that perhaps this may have been related to the fact that we use maven and maybe that was throwing another complication into the mix. As it turns out, if you don't provide a location of the deployed war to the configurations, GWT tries to access what it thinks the location. The directory does in fact not exist, nor is it where my deployed war lives. After some random clicking around and setting the directory to different places that may make sense, I figured out what it was looking for. So, in summary, this is another way to get the GWT debugger to work by manually configuring things:
- In eclipse, right click on your project and choose Debug as -> Debug Configurations ...
- In the Main tab, change the name of the configuration to something meaningful to you so you know what this configuration is for. The project should be pre-filled with the name of the GWT app that you right clicked over. If it isn't, or it is not correct, click on the browse button to select the project. This was a slight point of confusion for me, what project should I use? The code base I work on is very large with many modules. I chose the entry point into the application for the client as the GWT project ( and I chose correctly it seems ). I didn't know what main class to use or read up on what my options were, so I just left the default value.
And that's it! When you click on debug, you should see a tab on your screen where your console is that says "Development Mode". One other probably obvious thing is that you want to start up tomcat first before clicking debug. After this, you'll see in the Development Mode console a URL you can copy and paste into a browser and use for debugging the client side.
Yes, I know, this should be simple and straight forward, but I figured if I was having trouble ... I'm sure (hopefully) someone out there on the interwebs is having similar troubles.