bretondev
bretondev

Reputation: 139

GWT + Eclipse : Breakpoints do not work

Breakpoints do not work in my environment.

I have a GWT project in Eclipse which works well, but not the breakpoints. To run my project, I do Project > Debug as > GWT Development Mode with Jetty > code compiles > when ready, then open my page in the Firefox browser > the screen I

developed appears on the page, I click on the button that triggers a server-side method, it goes through the method but does not stop at the breakpoint

My configuration: Eclipse Mars.2 Release (4.5.2) GWT SDK 2.8.2 JRE 1.8.0_144

TRY #1: I have tried putting the following tags in my gwt.html file , without success:

  <add-linker name="xsiframe"/>
  <set-configuration-property name="devModeRedirectEnabled" value="true"/>

Thanks

Upvotes: 1

Views: 1910

Answers (3)

El Hoss
El Hoss

Reputation: 3832

Assuming, that you are familiar with SDM (SuperDevMode) and SBDG and are using it.

There is not 1:1 relation between a Java-statement and a JavaScript-statement. So, sometimes, there is no correlation and the debugger has no line in the JavaScript to stop.

In this case you have to use the

GWT.debugger();

statement in your code to initiate a breakpoint.

Hope that helps.

Upvotes: 0

Ming Leung
Ming Leung

Reputation: 385

My configuration GWT2.8.1, Eclipse Oxygen, SuperDevMode, SDBG with chrome, which are all default setting. The debugger does not stop with some breakpoints like

    final Button sendButton = new Button("Send to Svr");
    final TextBox nameField = new TextBox();
    nameField.setText("GWT User");
    final Label errorLabel = new Label();

But the breakpoints work with code like

        public void onClick(ClickEvent event) {
            sendNameToServer();
        }

After adding the GWT.debugger() right after the onMoudleLoad, the breakpoints work. But anything to do with the production deploy version?

Upvotes: 0

Akkusativobjekt
Akkusativobjekt

Reputation: 2023

Lets start with this quote from the GWT docu:

Super Dev Mode replaces the internals of Dev Mode with a different approach that works better in modern browsers. Like its predecessor (which I’ll call classic Dev Mode), Super Dev Mode allows GWT developers to quickly recompile their code and see the results in a browser. It also allows developers to use a debugger to inspect a running GWT application. However, it works differently.

You did not specify if you are using the (old) Classic dev mode or the (new) Super Dev Mode. Actually I don't know if the old one is available in GWT 2.8 .

About debugging the documentation states:

Super Dev Mode compiles entire GWT applications to JavaScript, similar to production mode. This means we can’t use a normal Java debugger like in classic Dev Mode. Instead, we will use the browser’s debugger. (I recommend using Chrome for now.)

So now you have basically 2 options:

  1. Debug the JavaScript (!) Code in/with a browser in Super Dev Mode
  2. Debug the Java Code with Eclipse in conjunction with a browser in a specific version (We used a FF ESR version), which still supports the GWT Dev Plugin. Without the plugin you will not be able to debug the client code *1:

Bonus: There is a github project which states "SDBG - Eclipse debugger for GWT SuperDevMode", but I didn't have tried it.

*1 I'm not 100 % sure about this statement, but I believe you can always debug the server code of your gwt application.

Upvotes: 1

Related Questions