Sunday, June 07, 2009

GWT not hitting breakpoints in hosted mode

With Eclipse 3.4.2 (Ganymede), Google Web Toolkit, and JDK 1.6.0_14, the debugger seemed to ignore my breakpoints while running the hosted-mode browser even though the breakpoint indicators had checkmarks while the app was running. I added calls to GWT.log, and the server's log output demonstrated that control was definitely passing through my breakpoints.

Google's Rajeev Dayal confirms the problem, and Eclipse has a ticket associated with this issue.

One workaround is falling back to JDK 1.6.0_13. If you don't have it yet, download it from Sun, and tell Eclipse about it:

  1. In Eclipse select Window > Preferences.
  2. In the Preferences dialog, select Java > Installed JREs.
  3. In the Installed JREs panel, select the Add... button.
  4. In the Add JRE dialog, select Standard VM and then the Next button.
  5. Select the Directory... button next to the textbox labeled JRE home and navigate to the JRE bundled with JDK 1.6.0_13 (e.g., C:\Program Files\Java\jdk1.6.0_13\jre). This should add several JARs to the list of JRE system libraries.
  6. Select the Finish button.
  7. Back in the Installed JREs panel, check the JRE for update 13, and then click
Set breakpoints, launch the debugger, and your application should now be stopping when control reaches the specified lines of code!

UPDATE: early-access release 6u18 is reported to fix this problem.

4 comments:

James said...

Thank you! The fix worked.

It was quite confusing to not have breakpoints working as I went through the GWT Getting Started Tutorial. Since the breakpoints never hit, Eclipse never switched into the debug perspective, which the tutorial assumed.

Here's a direct link to Java 6 update 13.

http://java.sun.com/products/archive/j2se/6u13/index.html

Anonymous said...

I encountered this problem using jdk 1.6.0_11 and eclipse 3.4.2 Thanks for the help.

Unknown said...

Thank you. same problem (GWT1.7 + Eclipse 3.5)

Cornelius said...

I had the same problem and installed the latest version (JDK 1.6.0_16) and it is now fixed. One of the bugs fixed in 1.6.0_16 is that breakpoints were not working.

-ChrisNovak