GWT Server and debug

225 views
Skip to first unread message

Jasper Suijker

unread,
Jul 6, 2020, 11:05:13 AM7/6/20
to google-we...@googlegroups.com
LS,

We are using GWT to get our Swing gui available in web.
This works nicely. After compiling, we deploy our application in tomcat and it runs and shows the same screens as we have in Swing.

Now we want to debug the web parts through the gwt Jetty server. (GWT development mode)
To be able to debug, you Start the jetty server and it will give you a url like: http://127.0.0.1:8888/<appp>?gwt.codesvr=127.0.0.1:9997
The part after the question mark is the magic of the GWT server, being able to debug your code. As far as i know this only works in Internet Explorer, is that correct?

Internet Explorer is terrible to work with, the javascript engine is terrible and large memory usage, etc....
Microsoft is already pushing users towards Edge, so Internet explorer will stop at some point..
Is there another way to debug GWT?

Regards,

Jasper


Thomas Broyer

unread,
Jul 6, 2020, 8:14:06 PM7/6/20
to GWT Users
gwt.codesrv is a sign that you're using the deprecated so-called "classic" DevMode, that relies on a browser plugin, that indeed only works in Internet Explorer nowadays.
If you haven't already, then first upgrade to at least GWT 2.7.0 (of course 2.9.0 would be a lot better),
then you'll be able to use SuperDevMode the same way as you're used to run DevMode, except you don't have to install any plugin: just load the page in your browser and it'll automatically trigger the compilation of your code.
Your code will then run in JS in your browser, and you'll debug it from your browser's developer tools, leveraging source maps (Chrome or Edge work better, likely Safari too; Firefox used to be sluggish but that was supposed to be better in recent versions, haven't tried it yet though).
See http://www.gwtproject.org/articles/superdevmode.html to learn more about SuperDevMode.

Jasper Suijker

unread,
Jul 7, 2020, 6:02:19 AM7/7/20
to GWT Users
Hi,

We are running with 2.8.2 and want to migrate to 2.9.0 later on.
this is my current gwt server start with arguments:
Main class: 
  com.google.gwt.dev.DevMode
arguments: 
   com.test.demo.webclient
  -war GWT/war
  -nosuperDevMode
  -startupUrl demo

What do i need to change to make it start in superdevmode? (remove -nosuperDevMode?)

regards,

Jasper


Op dinsdag 7 juli 2020 02:14:06 UTC+2 schreef Thomas Broyer:

Colin Alworth

unread,
Jul 7, 2020, 9:09:43 AM7/7/20
to GWT Users
Yes, remove -nosuperDevMode.

Jasper Suijker

unread,
Jul 8, 2020, 12:46:28 AM7/8/20
to google-we...@googlegroups.com
Ok, 
I removed  -nosuperDevMode and started the server via debug of eclipse.
I made some breakpoints in the code, but somehow they are not triggered.
With the plugin and using internet explorer i see a "unknown" tab showing in the GWT development Mode. But when running "just" in the superdevmode i don't see that.
Maybe i am missing or using a configuration in one of the xml files, which is preventing debugging?

Regards,

Jasper

Op di 7 jul. 2020 om 15:10 schreef Colin Alworth <nilo...@gmail.com>:
--
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/057e4f32-d3ce-4401-ac04-40db4c2d3141o%40googlegroups.com.

Mbuso Kotobe

unread,
Jul 8, 2020, 1:20:07 AM7/8/20
to google-we...@googlegroups.com
Run the code using Debug as and Choose Open With SDBG Chrome JS Debugger

It will trigger breakpoints 

I also had the same problem few weeks ago but using that helped so Try it

Cheers

Jasper Suijker

unread,
Jul 8, 2020, 2:45:10 AM7/8/20
to google-we...@googlegroups.com
Hi,

This SDBG plugin assumes you are using the gwt plugin in eclipse. 
We have our projects as "normal" java projects and when we want to test, we run an eclipse launch with the correct parameters.

I have tried converting the project to a gwt project, but then a run into (gwt) classpath errors, which i am not able to fix.
If i want to debug the application in web and not use Internet explorer, i need to use the eclipse plugin or is there an other way?

regards,

Jasper


Op wo 8 jul. 2020 om 07:19 schreef Mbuso Kotobe <mbusoko...@gmail.com>:

Thomas Broyer

unread,
Jul 8, 2020, 6:20:46 AM7/8/20
to GWT Users


On Wednesday, July 8, 2020 at 6:46:28 AM UTC+2, Jasper Suijker wrote:
Ok, 
I removed  -nosuperDevMode and started the server via debug of eclipse.
I made some breakpoints in the code, but somehow they are not triggered.
With the plugin and using internet explorer i see a "unknown" tab showing in the GWT development Mode. But when running "just" in the superdevmode i don't see that.
Maybe i am missing or using a configuration in one of the xml files, which is preventing debugging?

→ “Your code will then run in JS in your browser, and you'll debug it from your browser's developer tools, leveraging source maps (Chrome or Edge work better, likely Safari too; Firefox used to be sluggish but that was supposed to be better in recent versions, haven't tried it yet though).”

Breakpoints in server code will work as before though.

Jasper Suijker

unread,
Jul 10, 2020, 2:33:58 AM7/10/20
to GWT Users
Gwt by default converts my(your) code to javascript (JS). With the "old" browser plugin we were able to add breakpoints in the client java code and when running the app, the debugger stopped at those points.
I understand, that when running in superdevmode, this works differently.
Does anyone has een extended example on how to set this superdevmode up and do the debugging with browser's developer tools?



Op woensdag 8 juli 2020 12:20:46 UTC+2 schreef Thomas Broyer:

Craig Mitchell

unread,
Jul 19, 2020, 7:32:04 PM7/19/20
to GWT Users
It should just work.  Like many other tools out there, SuperDevMode uses JavaScript source maps (the old way used plugins, which are no longer allowed in most browsers).  If you debug your app in Chrome dev tools, the source you will see will be your Java code in the debugger (not the compiled JS code).

All the SDBG plugin does, is hook into Chrome so you can debug in Eclipse, instead of needing to use the Chrome dev tools debugger.

Maybe create a new hello world app, just to see how it works:  http://www.gwtproject.org/

Frank

unread,
Jul 27, 2020, 5:55:04 AM7/27/20
to GWT Users
When I still used Eclipse I always used the plugin from  Brandon Donnelson :  https://github.com/gwt-plugins/gwt-eclipse-plugin 

On that GitHub mainpage is a link to a YouTube playlist (under Reference). Just watch those and you should know everything you need to know about working with the plugin/superdevmode/breakpoints.

Op maandag 20 juli 2020 om 01:32:04 UTC+2 schreef Craig Mitchell:

Craig Mitchell

unread,
Aug 19, 2020, 5:49:05 AM8/19/20
to GWT Users
> When I still used Eclipse I always used the plugin from  Brandon Donnelson :  https://github.com/gwt-plugins/gwt-eclipse-plugin 

I'm guessing that's the same one that's in the install instructions:  http://www.gwtproject.org/usingeclipse.html#installing  

Reply all
Reply to author
Forward
0 new messages