James-Jesse Drinkard
James-Jesse Drinkard

Reputation: 15723

Service code debugging question with GWT 2.1

I recently attempted to set new breakpoints in eclipse to debug service side code in GWT. For some reason eclipse refused to see the breakpoints or the new code changes I had made. In the debugger it would open up what appeared to be an ear file from somewhere. Even though I had deleted the old ears, compiled and redeployed the new ear files. We are using GWT 2.1, JBoss 4.3, java 1.6 and Eclipse Helios. Finally, when I created a new environment with the code from scratch it started working. Any ideas as to what was holding on to the old code? BTW, I had rebooted my machine and restarted eclipse, but it also didn't make any difference. Thanks, James

Upvotes: 1

Views: 634

Answers (2)

James-Jesse Drinkard
James-Jesse Drinkard

Reputation: 15723

I think JBoss was somehow caching things in it's temporary files and then I had forgotten about adding source in. This may be a JBoss thing as I don't recall seeing it with other application servers before.

So after I cleared out the cache, what got me thinking about the source was the fact that eclipse would stop on the breakpoints in the debugger that I had just set, but I couldn't see the source files.

Prior to this I was apparently hitting the breakpoints in the cached files and I couldn't alter them by setting new breakpoints. That was the root cause of the issue. Then by adding in the source from the ear, I got the debugger in sync with the code and it started working fine.

Upvotes: 0

Xorty
Xorty

Reputation: 18861

Current state of debugging GWT apps is ... well not really good. Sometimes it's incredibly slow (development mode), sometimes lot of rubbish stays at webserver.

This might not solve your problem directly, but here are some advices from me:

  1. Writing new client code (/client) at GWT means refreshing browser
  2. Writing new server code means "Reloading web server". You have little yellow "refresh" button in Eclipse in "Development Mode" tab. This should reflect all the changes done at server side.
  3. Embedded Jetty works usually well with GWT debugging. If you are not doing something jboss-server-specific, it should also work fine at production server. Just make sure your unit tests pass ;-)
  4. You can ofcourse debug GWT application on external server, see this section of documentation (I guess you do on JBoss)
  5. Be sure to remove all old files when reloading web server. It happened to me, that sometimes there were some weird old mixed up files (I was using Tomcat though). So you might want to write own clean script.
  6. You must be absolutely sure that your serever code even launched! Use lot of GWT.log() at client side, that will ensure you in this. Don't worry, GWT.log are ommitted in production mode.
  7. Be sure to inspect client-side page, it sometimes help to find out that your server code didn't manage to launch.
  8. Log every public void onFailure(final Throwable caught) { of your AsyncCallbacks to get more info.
  9. Don't use Google Chrome in development mode. It's MUCH slower than Firefox.

Otherwise, if you're using most recent version of your application, Eclipse must stop at breakpoint correctly.

Upvotes: 1

Related Questions