Why when starting GWT in debug mode, my break points don't break

前端 未结 10 1611
一向
一向 2020-12-06 05:08

I am using Eclipse 3.4.2 with the latest GWT. The IDE doesn\'t even switch to Debug Perspective automatically.

相关标签:
10条回答
  • 2020-12-06 05:43

    Do you launch your GWT application in hosted mode ?

    You will spend most of your development time running your application in hosted mode, which means that you are interacting with your GWT application without it having been translated into JavaScript.
    Anytime you edit, run, and debug applications from a Java integrated development environment (IDE), you are working in hosted mode.
    When an application is running in hosted mode, the Java Virtual Machine (JVM) is actually executing the application code as compiled Java bytecode, using GWT plumbing to automate an embedded browser window.
    This means that the debugging facilities of your IDE are available to debug both your client-side GWT code and any server-side Java code as well.


    Tip: If you are using Eclipse, you can also create a launch configuration file when creating a new project with applicationCreator by using the -eclipse flag.

    If you didn't use applicationCreator to create an application-specific hosted mode shell script, you can manually run the main class in com.google.gwt.dev.GWTShell found (depending on your OS) in gwt-dev-windows.jar, gwt-dev-linux.jar, or gwt-dev-mac.jar.

    Important: If you are not using the generated <module>-shell script, be aware that in hosted mode, the GWT development shell looks for modules (and therefore client-side source) using the JVM's classpath. Make sure to add your source directories first in your classpath.


    See also Debug in Hosted Mode

    alt text http://google-web-toolkit-doc-1-5.googlecode.com/svn/wiki/StockWatcherDebug1.png

    0 讨论(0)
  • 2020-12-06 05:45

    Changing the JDK didn't help in my case, but I have finally found out what's wrong.

    When moving from GWT 1.7 to 2.0 the old GWT classes will stay on the war ouput. They must be manually deleted in order for 2.0 to kick in.

    0 讨论(0)
  • 2020-12-06 05:51

    I have found a different thread in groups discussing my problem.

    http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/a9b553a6df5da5b8/65298c48c32deac0?lnk=raot&pli=1

    Basically, JDK 1.6.0_14 will not work with GWT in eclipse debug mode. Switching a different JDK will work.

    0 讨论(0)
  • 2020-12-06 05:54

    I'm running 1.6.0_13 and still the debug doesn't work. It just doesn't hit the breakpoints. And more, the page shows up blank in hosted mode (except for the static content in the HTML file), but everything displays and works correctly when running on the browser.

    java -version
    java version "1.6.0_13"
    Java(TM) SE Runtime Environment (build 1.6.0_13-b03)

    0 讨论(0)
提交回复
热议问题