How to debug the java code on the eclipse ide with the tbroyer gwt maven plugin ?

131 views
Skip to first unread message

Marco Tenti (IoProgrammo88)

unread,
Dec 4, 2023, 7:16:20 AM12/4/23
to GWT Users
Hello everyone, I am updating some old gwt projects and I started to study about 15 days ago the gwt framework, this is to specify that I don't know all the secrets of the framework yet.

Following Nalu's approach and starting from his example at https://github.com/NaluKit/nalu-examples/tree/main/nalu-simple-app-example, I was able to start with the gwt:codeserver both client and server part of my projects successfully.

Unfortunately, I still haven't figured out what I need to do to enablethe  debugging on the client part of the project on the IDE eclipse.

I've read in this issue https://github.com/tbroyer/gwt-maven-plugin/issues/82 a possible solution, but it doesn't seem to work, I'm 100% sure I'm doing something wrong myself., can anyone tell me looking at Nalu's example what additional commands I need to set to configure to debugging on the client java code in the eclipse ide ?

Ralph Fiergolla

unread,
Dec 4, 2023, 7:30:37 AM12/4/23
to google-we...@googlegroups.com
If I am not mistaken, you are mixing up things a little: the issue you were looking at here https://github.com/tbroyer/gwt-maven-plugin/issues/82 is not about debugging the generated client part of your application, but about the compiler that is actually generating the code you want to debug.

To avoid wasting your time trying to set up the Eclipse Plugin I would suggest using your browser's built-in development tools (Ctrl+Shift+I). You will see your JAVA source code and can put your breakpoints etc. and step through your code. This works in Chrome, Firefox, Edge.

Bon courage
Ralph

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/3369c8a1-d86f-40de-9816-d35d865a1e4en%40googlegroups.com.

Marco Tenti (IoProgrammo88)

unread,
Dec 11, 2023, 7:31:15 AM12/11/23
to GWT Users
So this debug mode is deprecated  https://www.gwtproject.org/doc/latest/tutorial/debug.html  ?

When I launch the "gwt:codeServer" command, i  go to the sources panel of the browser chrome, and I can browse the code and set the breakpoints , but I can not "see" the runtime values of the variables as it happens with standard javascript is this correct ?

 ErrorPskCallStack.png

Ralph Fiergolla

unread,
Dec 12, 2023, 1:26:16 AM12/12/23
to google-we...@googlegroups.com
Yes, unfortunately the Eclipse plug-in is no longer maintained. Debugging in the browser is the way to go! It works the same as for other JavaScript frameworks (e.g. Angular) using a standard feature to map generated JavaScript onto the source code (be it Java or Typescript etc.). That is, you can set breakpoints and inspect the runtime values of your variables. There is just one issue with variable names which differ between Java and JavaScript but this is mostly cosmetic.

Colin Alworth

unread,
Dec 12, 2023, 9:39:29 AM12/12/23
to GWT Users
The gwt-eclipse-plugin is maintained, but browsers removed the API that was previously used to let a Java debugger connect to a running GWT application. This API was used by a browser plugin that was shipped as part of GWT. Technically GWT still supports this, but I believe only IE11 (and htmlunit) can actually use it, and its use is discouraged, some other GWT features will not work with it.

There is a separate plugin, https://sdbg.github.io/ that is also maintained, that allows eclipse to debug GWT apps via sourcemaps, much the same as the browser's own debugger will do.

The issues you're observing with variable renaming making it difficult to inspect values is caused by limitations in JS sourcemaps themselves.

Juan Pablo Gardella

unread,
Dec 12, 2023, 9:44:34 AM12/12/23
to google-we...@googlegroups.com
Which limitation are you referring to? Is it something that can be fixed or is it impossible to fix variable names there?

Thomas Broyer

unread,
Dec 12, 2023, 10:47:40 AM12/12/23
to GWT Users
On Tuesday, December 12, 2023 at 3:44:34 PM UTC+1 gardella...@gmail.com wrote:
Which limitation are you referring to? Is it something that can be fixed or is it impossible to fix variable names there?

> The group’s plan is to identify the gaps, bring completeness and clarity to the current specification; and help source map debuggers, generators and tools to adhere to the updated specification. The intent is to work together on adding long requested features such as passing through function and variable names, and debug IDs to quickly identify source files or scope information. 

(emphasis mine)

Colin Alworth

unread,
Dec 12, 2023, 10:50:43 AM12/12/23
to GWT Users
That's great news! Related, I had understood that this didn't work at all, but I discovered via https://bugs.chromium.org/p/chromium/issues/detail?id=327092 that there is an "experimental" feature in chrome that lets locals be displayed.
screenshot867.png
However even with this enabled, only locals/params will show up with their correct names - any fields on those, or fields on "this" will still require finding their obfuscated names.

Juan Pablo Gardella

unread,
Dec 12, 2023, 11:08:00 AM12/12/23
to google-we...@googlegroups.com
Did you check if that solves the problem of variable names?

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages