How to debug GWT application on Eclipse

2,809 views
Skip to first unread message

Pierre Mineaud

unread,
Jun 24, 2016, 4:46:52 AM6/24/16
to GWT Users
Hi GWT community. 
I am trying GWT since yesterday, and I'm following the first app tutorial on gwt official.
I'm at the debugging section and i can't figure it out to debug my code in eclipse. 

I followed each line of this tutorial, so this is what I've done : 
- Installed the last eclipse version (Version: Neon Release (4.6.0))
- Installed GWT pluggin for eclipse + sdk : Plugin for Eclipse 4.5 (Mars)
- Created the first app Stockwatcher from the eclipse pluggin (I didn't used webAppCreator or maven atm)
- Built my UI code

Until there, all is working fine. I use the run as Web Application (GWT Super Dev Mode) in eclipse and I see my app working in chrome at the http://127.0.0.1:8888/StockWatcher.html.

The problem I have now during the debugging part is, when I put some breakpoint in my code, I relaunched my app in the same mode (GWT Super Dev Mode) but my code never stopped on my breakpoint. So I tried to launch it with Debug as Web Application (GWT Super Dev Mode)... Same here : No stop on breakpoint. So I tried an other mode : Run/Debug as Web Application (GWT Classic Dev Mode), my generated url changed to http://127.0.0.1:8888/StockWatcher.html?gwt.codesvr=127.0.0.1:9997. But when I launched it in my chrome / FF, I got this popup : "Couldn't load stockwatcher from Supder Dev Mode server at http://127.0.0.1:9876. Please make sure this server is ready. Do you want to try again?"

What I did wrong ?

Thanks for your tips ;)

Thomas Broyer

unread,
Jun 24, 2016, 5:03:38 AM6/24/16
to GWT Users
"Classic" Dev Mode (or, as most people call it, "legacy" devmode) is deprecated and scheduled for deletion after the 2.8 release. It only works in Internet Explorer (not Edge, but works in IE11), and in really old versions of Firefox and Chrome/Chromium.
The way forward is "Super Dev Mode", where your application is compiled to JS on-demand, on-the-fly. This however means that you need to use JavaScript debugging tools, but thanks to SourceMaps you can see your original Java code when debugging. Those tools include your browsers' dev tools, the Eclipse SDBG plugin https://sdbg.github.io (only works with Chrome AFAICT), and IntelliJ IDEA built-in support (IIRC, requires a browser extension, but works in both Chrome and Firefox).

Pierre Mineaud

unread,
Jun 24, 2016, 5:32:02 AM6/24/16
to GWT Users
Wow... thanks a lot Thomas for your fast and good reply ! 
This isn't really clear in the doc, but this clear for me now. And after followed your linked, it works like a charm.
Thanks again :)

Frank

unread,
Jun 24, 2016, 5:35:48 AM6/24/16
to GWT Users
Like Thomas said. Don't use DevMode but keep using SuperDevMode.

The easiest way to do debugging is to use Chrome as a browser.

- When running your app in SuperDevMode press F12 in Chrome.
- This will show the Chrome developer tools window
- In this panel select the 'sources' tab
- Then in the tree view open 'top', open {nameOfYourApp}, open 127.0.0.1:9876, open "sourcemaps/{nameOfYourApp}.
- Now you will find your original java source. If you open a java file here you can set a breakpoint in Chrome...


Jens

unread,
Jun 24, 2016, 5:39:22 AM6/24/16
to GWT Users
- Then in the tree view open 'top', open {nameOfYourApp}, open 127.0.0.1:9876, open "sourcemaps/{nameOfYourApp}.
- Now you will find your original java source. If you open a java file here you can set a breakpoint in Chrome...

Alternatively, on Mac, just hit CMD + O (open) and enter your Java file name. Not sure about the shortcut on windows/linux but I guess you quickly figure it out.

-- J.

Thomas Broyer

unread,
Jun 24, 2016, 5:46:36 AM6/24/16
to GWT Users
Ctrl+O 

Pierre Mineaud

unread,
Jun 24, 2016, 6:12:31 AM6/24/16
to GWT Users
Oh great, could be enough to debug in chrome debugger, but I guess it will be more confortable to debug directly in eclipse.
Thanks for all the infos ;)

Frank

unread,
Jun 24, 2016, 7:08:40 AM6/24/16
to GWT Users
Didn't now about that CTRL+O thing.
Thanks :-)

Velusamy Velu

unread,
Jun 29, 2016, 10:19:02 AM6/29/16
to GWT Users
I was always using the un-intuitive CTRL-P in Chrome, Firefox, and Opera. CTRL-O is more logical.
First I right clicked on the application and selected "Inspect Element" then did the CTRL-P or CTRL-O.
Reply all
Reply to author
Forward
0 new messages