Cannot Debug GWT with Eclipse

1,892 views
Skip to first unread message

Namline

unread,
Oct 16, 2016, 1:10:55 PM10/16/16
to GWT Users
Hi,

I am trying to debug a very simple HTML GWT module in Eclipse, but the breakpoint in my EntryPoint class does not get hit! I have the following setup:

GWT version: 2.7
Eclipse version: Mars 4.5.2
Chrome version: 53
Running mode: Super Dev Mode (debug)

My module contains a simple HTML file with one EntryPoint (It's a proverbial HelloWorld). The application starts normally when I do Run As Super Dev Mode or Debug As Super Dev Mode, and I see server's and client's URL's and ports with no errors. I can navigate to the application HTML URL (Chrome v53), see my simple Label, and even recompile and see the changes if I modify the EntryPoint class which contains that simple Label.

I have set my argument's log level to DEBUG (see tons of loading various modules) and even check marked Debug As Configuration to stop at the main method. The thing is, when I run the application in Debug Super Dev Mode for the first time to start the core server, I can see the breakpoint stopping in DevMode class' main() method (not afterward though when I make changes to the EntryPoint and recompile by refreshing the browser). But when I set a breakpoint in my EntryPoint's onModuleLoad(), it gets ignored!

How can I get the server to put a hook on my EntryPoint?

zakaria amine

unread,
Oct 16, 2016, 2:26:46 PM10/16/16
to GWT Users
are you using Eclipse breakpoints? I think you have to use GWT.debugger() method. 

Jens

unread,
Oct 16, 2016, 3:46:59 PM10/16/16
to GWT Users
SuperDevMode compiles your Java source transparently to JavaScript, it never executes your Java source code directly in a JVM. So Java break points in your GWT app will never work.

That means with SuperDevMode you can only debug your code using the browser, as thats the one who actually executes the final JS code. You can either set break points in your browsers dev tools or install the Eclipse plugin "SDBG" which allows you to set break points in your IDE which are then synchronized to the browser.

-- J.

Namline

unread,
Oct 16, 2016, 4:01:55 PM10/16/16
to GWT Users
Zakaria,

I'm not following your suggestion here. What does a call to that particular method have to do with being able to set a breakpoint in Eclipse debugging (Super Dev Mode) to walk through the GWT application? (http://www.gwtproject.org/doc/latest/tutorial/debug.html)

What I am seeing is that the breakpoint in the EntryPoint class apparently is not attached to the debugging session (no tick mark), but the one in DevMode class does. I had previously created a GWT project using Eclipse plugin's wizard where I check marked generate code which resulted in creation of bunch of client and server classes (bare bone stuff). I was able to run the debugger with breakpoints set (and actually working) with that one, but not with this simple HTML module which does have an EntryPoint (just like the one created by the wizard).
 
I'm thinking if there is no RPC call between the client and server, then the debugging would not work with breakpoints, such as in this case where there is a simple HTML with nocache.js only.

Namline

unread,
Oct 16, 2016, 4:08:52 PM10/16/16
to GWT Users
Jens,

I don't know why this user group requires approval to post comments, but I think in my reply to Zakaria, I mentioned that I was able to invoke Eclipse debugging if there is a server side code, e.g. RemoteServiceServlet (and that's what I was seeing). But you are right; the client side does not run in a JVM so the session cannot be attached to the running client "Java" code which is basically a JavaScript after all running in the browser.

That being said, my understanding is that with ClassicDevMode, apparently it was possible to trace the client code too (that's according to the content of GWT in Action, 2nd Edition). So I thought SuperDevMode is also capable of doing the same.

Namline

unread,
Oct 16, 2016, 6:48:38 PM10/16/16
to GWT Users
Jens,

Actually, I took your advice and managed to set break points in Chrome's Developer tool (in Source tab, under sourcemap folder where the Java classes are) and debug from there (not that anything made sense with all the generated JavaScripts).

I also tried SDBG which more or less does the same thing but in the Eclipse as a plugin. I just followed the video on SDBG site and got it to work. What was confusing about it was to run debugging in SuperDevMode first, then rerun the Eclipse Debug As, but this time Launch Chrome from Debug Configuration. It actually spawns two (2) debugging sessions from the looks of it: one for Web Application (code server) and the other for Launch Chrome. Thanks for the recommendation.



On Sunday, October 16, 2016 at 3:46:59 PM UTC-4, Jens wrote:

Thomas Broyer

unread,
Oct 17, 2016, 3:24:09 AM10/17/16
to GWT Users
Maybe try out the new GWT Eclipse Plugin, which (AFAICT) bundles everything together: http://gwt-plugins.github.io/documentation/gwt-eclipse-plugin/debugging/Debugging.html

Brandon Donnelson

unread,
Oct 17, 2016, 1:40:43 PM10/17/16
to GWT Users
SDBG is the way to go for debugging, like they said. 

Keep in mind if the Chrome dev tools are open it will take over the breakpoints, and they are stated in Chrome dev tools. If Chrome dev tools are closed, and you opened debugging the browser with the SDBG Javascript debugger shortcut, then Eclipse is in charge of the break points, console output and trace inspection. 

I'll create a video and guide here shortly. And talk about it at GWT Con. https://github.com/gwt-plugins/gwt-eclipse-plugin/projects/2

Namline

unread,
Oct 17, 2016, 10:58:22 PM10/17/16
to GWT Users
Brandon,

Thanks. I just watched your video on YouTube. Excellent job for newbies like me.

Quick question. As a starter, I have Google Plugin for Eclipse installed. Do I have to uninstall it before installing GWT Eclipse Plugin V3?

Brandon Donnelson

unread,
Oct 17, 2016, 11:28:02 PM10/17/16
to GWT Users
Good question. The goal is to uninstall GPE or GPE-Fork. I put in a conflict so it will ask you to uninstall it. I recommend using Java EE Neon and starting with a clean install. I haven't tested enough of the uninstalling. In theory it should work fine. I did find some hiccups along the way, but I hadn't finished fixing bugs either, and did that along the way. If you're game, I'd be interested in hearing if you can just install the new plugin with GWT Eclipse Version 3, and have the GPE uninstalled along the way. When it asks you to instal the plugin, be sure to check the second radio, uninstalling GPE. You'll see what I mean if you go that route. 

Hope that helps,
Brandon

--
You received this message because you are subscribed to a topic in the Google Groups "GWT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/TOVusERKYhU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-tool...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Namline

unread,
Oct 18, 2016, 9:59:44 PM10/18/16
to GWT Users
Brandon,

Sorry for the delay in response (happy hours). So, here's what happened (I am running Eclipse Mars 4.5.2 (R2) with Google Plugin for Eclipse already installed (Windows 7)):

I installed GWT Eclipse Plugin 3.0.0 from Eclipse market place, and as you had suggested, on the second page, I chose the second radio to uninstall Google Plugin for Eclipse. Moreover I had GWT 2.8 unchecked (I won't be using it).
I did not run into any issue with the installation itself, however, when I attempted to run, debug, or compile my existing "HelloWorld" GWT application, it wasn't even recognizing it as a GWT project!
First, I had to reset the GWT library in the build config as it somehow had messed it up.
Second, I went to my existing GWT project's Properties -> Project Facets and select GWT option as it somehow had been removed.

Afterward, I was able to run and debug as normal.


On Monday, October 17, 2016 at 11:28:02 PM UTC-4, Brandon Donnelson wrote:
Good question. The goal is to uninstall GPE or GPE-Fork. I put in a conflict so it will ask you to uninstall it. I recommend using Java EE Neon and starting with a clean install. I haven't tested enough of the uninstalling. In theory it should work fine. I did find some hiccups along the way, but I hadn't finished fixing bugs either, and did that along the way. If you're game, I'd be interested in hearing if you can just install the new plugin with GWT Eclipse Version 3, and have the GPE uninstalled along the way. When it asks you to instal the plugin, be sure to check the second radio, uninstalling GPE. You'll see what I mean if you go that route. 

Hope that helps,
Brandon

On Mon, Oct 17, 2016 at 7:58 PM Namline <blahb...@gmail.com> wrote:
Brandon,

Thanks. I just watched your video on YouTube. Excellent job for newbies like me.

Quick question. As a starter, I have Google Plugin for Eclipse installed. Do I have to uninstall it before installing GWT Eclipse Plugin V3?



On Monday, October 17, 2016 at 1:40:43 PM UTC-4, Brandon Donnelson wrote:
SDBG is the way to go for debugging, like they said. 

Keep in mind if the Chrome dev tools are open it will take over the breakpoints, and they are stated in Chrome dev tools. If Chrome dev tools are closed, and you opened debugging the browser with the SDBG Javascript debugger shortcut, then Eclipse is in charge of the break points, console output and trace inspection. 

I'll create a video and guide here shortly. And talk about it at GWT Con. https://github.com/gwt-plugins/gwt-eclipse-plugin/projects/2

--
You received this message because you are subscribed to a topic in the Google Groups "GWT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/TOVusERKYhU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-toolkit+unsub...@googlegroups.com.

Brandon Donnelson

unread,
Oct 18, 2016, 11:51:22 PM10/18/16
to GWT Users
Thanks for the update. Sounds like some of the name space had to be reset in the configuration. I've seen this happen until the project is refreshed or reimported. 

On Tue, Oct 18, 2016 at 7:00 PM Namline <blahb...@gmail.com> wrote:
Brandon,

Sorry for the delay in response (happy hours). So, here's what happened (I am running Eclipse Mars 4.5.2 (R2) with Google Plugin for Eclipse already installed (Windows 7)):

I installed GWT Eclipse Plugin 3.0.0 from Eclipse market place, and as you had suggested, on the second page, I chose the second radio to uninstall Google Plugin for Eclipse. Moreover I had GWT 2.8 unchecked (I won't be using it).
I did not run into any issue with the installation itself, however, when I attempted to run, debug, or compile my existing "HelloWorld" GWT application, it wasn't even recognizing it as a GWT project!
First, I had to reset the GWT library in the build config as it somehow had messed it up.
Second, I went to my existing GWT project's Properties -> Project Facets and select GWT option as it somehow had been removed.

Afterward, I was able to run and debug as normal.


On Monday, October 17, 2016 at 11:28:02 PM UTC-4, Brandon Donnelson wrote:
Good question. The goal is to uninstall GPE or GPE-Fork. I put in a conflict so it will ask you to uninstall it. I recommend using Java EE Neon and starting with a clean install. I haven't tested enough of the uninstalling. In theory it should work fine. I did find some hiccups along the way, but I hadn't finished fixing bugs either, and did that along the way. If you're game, I'd be interested in hearing if you can just install the new plugin with GWT Eclipse Version 3, and have the GPE uninstalled along the way. When it asks you to instal the plugin, be sure to check the second radio, uninstalling GPE. You'll see what I mean if you go that route. 

Hope that helps,
Brandon

On Mon, Oct 17, 2016 at 7:58 PM Namline <blahb...@gmail.com> wrote:
Brandon,

Thanks. I just watched your video on YouTube. Excellent job for newbies like me.

Quick question. As a starter, I have Google Plugin for Eclipse installed. Do I have to uninstall it before installing GWT Eclipse Plugin V3?



On Monday, October 17, 2016 at 1:40:43 PM UTC-4, Brandon Donnelson wrote:
SDBG is the way to go for debugging, like they said. 

Keep in mind if the Chrome dev tools are open it will take over the breakpoints, and they are stated in Chrome dev tools. If Chrome dev tools are closed, and you opened debugging the browser with the SDBG Javascript debugger shortcut, then Eclipse is in charge of the break points, console output and trace inspection. 

I'll create a video and guide here shortly. And talk about it at GWT Con. https://github.com/gwt-plugins/gwt-eclipse-plugin/projects/2

--
You received this message because you are subscribed to a topic in the Google Groups "GWT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/TOVusERKYhU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-tool...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "GWT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/TOVusERKYhU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-tool...@googlegroups.com.

Namline

unread,
Oct 19, 2016, 9:17:54 PM10/19/16
to GWT Users
Is there a way to debug the GWT application (client and server) just like your plugin allows while running in SuperDevMod while it has been deployed on an application server, e.g. WebSphere with say, localhost:9080/MyApp context root?
To unsubscribe from this group and all its topics, send an email to google-web-toolkit+unsub...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "GWT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/TOVusERKYhU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-toolkit+unsub...@googlegroups.com.

Brandon Donnelson

unread,
Oct 20, 2016, 12:41:41 AM10/20/16
to GWT Users
Sure you can debug on any server, that said, if the web server is on a different ip than the code server there's an issue to workaround, b/c the project.nocache.js has hostname issue. I'm not sure if this is the case for you yet, but usually when you want to debug on a different server they have a different ip. 

Before I go into this, I'd like to know if the web server ip is the same as the code server ip? Let's say you get the project.nocache.js, by pointing the launcherDir at war output path, or by using a publishing routine, then you load the page, it should compile. Except the nocache.js script uses $window.location.hostname to get the code server address. Instead you can hand change the ip before pushing it the server, which is laborious, or use a class clobber, by using this on the classpath https://github.com/gwt-plugins/codeserver/blob/master/codeserver/src/main/java/com/google/gwt/dev/codeserver/LauncherDir.java#L127. Or maybe I get my patch accepted to make it possible to easily debug on a external server with a different ip than the code server. 

https://github.com/gwtproject/gwt/issues/9446 - patch proposal for easily debugging on a server with different ip. 

Describe your networking config for you servers and I can help more. 

-Brandon

Jens

unread,
Oct 20, 2016, 4:21:31 AM10/20/16
to GWT Users

Is there a way to debug the GWT application (client and server) just like your plugin allows while running in SuperDevMod while it has been deployed on an application server, e.g. WebSphere with say, localhost:9080/MyApp context root?

As long as the Application server runs on the same host/ip as the SuperDevMode CodeServer it works. Just use -launcherDir to point to your /war output folder. If running the application server on a different host / ip you would need to use a reverse proxy so that calls to localhost/MyApp map to otherIp:9080/MyApp. We use a reverse proxy approach like forever at work to either deploy locally or on a different server, and it works pretty well. But granted its a bit more work to setup.

-- J.

Vassilis Virvilis

unread,
Oct 20, 2016, 4:39:34 AM10/20/16
to google-we...@googlegroups.com
Hi,

Are we talking about debugging using SDBG plugin, setting breakpoints from the IDE +that kind of thing?

Because if you don't you don't need any reverse proxies for http. I am using it all the time and development machine where the codeserver runs is different from the production server. I am also not using the -launcherDir option. For https support the setup is more involving (and may require some proxies or certificate handling) and I haven't set it up yet.

In pure superdevmode with -style DETAILED I get a javascript that resembles a lot my java code and I use that to set breakpoints in javascript from the browser, Chrome also shows the java sources I think. But even if source maps are not working the generated javascript is easily readable and mappable to your original sources.

I am using ssh reverse proxies when I want to debug other browser/OS combinations with RDP (remote desktop protocol) because in that case there are 3 computers involved
  - developer machine - runs IDE, codeserver - rdp client - shows client desktop
  - client computer - rdp server - runs OS/Browser combo to test
  - production server

Now with the https promotion I need to be able to test/SDM also production https sites and that needs more reading/understanding/work.

    Vassilis


--
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-toolkit+unsub...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.



--
Vassilis Virvilis

Thomas Broyer

unread,
Oct 20, 2016, 5:58:12 AM10/20/16
to GWT Users


On Thursday, October 20, 2016 at 10:39:34 AM UTC+2, Vassilis Virvilis wrote:
Hi,

Are we talking about debugging using SDBG plugin, setting breakpoints from the IDE +that kind of thing?

Because if you don't you don't need any reverse proxies for http. I am using it all the time and development machine where the codeserver runs is different from the production server. I am also not using the -launcherDir option.

If you use the bookmarklets then yes, that won't be an issue (you may have other issues due to limitations of the bookmarklets, but at least not that one; that's why bookmarklets aren't recommended since 2.7.0 was released).
What they're talking about here is the interaction of -launcherDir and serving it from another machine (pointing -launcherDir to an NFS share or similar); see the issue linked to by Brandon.

I'll try to build a "devserver" that would do the reverse-proxying *and* some "magic" (paths whitelisting) to serve files directly from the codeserver; so you'd launch it like the codeserver with an additional URL to reverse-proxy to (see https://github.com/gwtproject/gwt/issues/9437#issuecomment-250926589)
But in the mean time, refer to the above discussion.

Vassilis Virvilis

unread,
Oct 20, 2016, 7:45:55 AM10/20/16
to google-we...@googlegroups.com
Thanks for the pointer.

From the cited github thread I didn't understand If you deprecate bookmarklets  will I be able with the new scheme to?

1) debug cors enabled GWT widget in the production site?
2) will it work with different OS/browsers combinations from my development PC (my RDP setup). Or it will need some setup for every test environment.
3) Assuming 1 will it also work for https:// connections?

1 + 2 is done currently by bookmarklets. Only 3 requires more setup.

   Vassilis


--
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-toolkit+unsub...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.



--
Vassilis Virvilis

Namline

unread,
Oct 20, 2016, 8:26:24 PM10/20/16
to GWT Users
My setting is straightforward although I have to say this is simply for me to start learning about debugging GWT, and more so, doing it on an external server (so I don't have much restrictions). I am running WebSphere Application Server (8.5.5) and have my GWT application deployed (war) which I can access/view.

The WAS runs on localhost IP with 9080 port. What arguments do I have to pass to be able to hook the debugging session to my web application deployed on the application server?

Brandon Donnelson

unread,
Oct 21, 2016, 12:59:58 AM10/21/16
to GWT Users
There are only two arguments needed to run GWT Development Mode (a.k.a Super Dev Mode.) If you're using the new GWT Eclipse Plugin V3, use the GWT Development Mode to start up the Super Dev Mode CodeServer. The arguments will be -launcherDir path/to/WAS/webapp/dir and gwt module.  Then, you'll notice a directory show up in your web app directory. Then go to the web page and it should start to compile. 

The exact same configuration as the tomcat can be done in this video. 


To unsubscribe from this group and all its topics, send an email to google-web-tool...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "GWT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/TOVusERKYhU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-tool...@googlegroups.com.

To post to this group, send email to google-we...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "GWT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/TOVusERKYhU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-tool...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages