What is Run/Debug Configuration for debugging GWT UI with Tomcat server?

First, to say what does work, and to help anyone else doing the same thing I am.

I can run a GWT application where the server code interacts with my deployed and running Tomcat server.  The documentation and docs available did not help much as so much of GWT and IntelliJ has changed.  I had to add GWT as a top level module (the "new" for GWT under "src" is missing so the online demo is obsolete, by the way), hand-edit my web.xml and startup HTML using the GWT as a sample (which is fine), and to have the build directory of GWT inherit from my project so the server code there can get at the code in my Tomcat app, and so it gets deployed with the rest.  I can set a breakpoint in my server code and hit it when I run the GWT UI.  Nice!

Debugging the client GWT app does not work.

The originally generated GWT sample app worked out of the box but stopped when I integrated the server-side code.  The GWT Run/Debug configuration refers to "Shell parameters" but in GWT 2.0.3  this has been replaced by "hosted mode" so there no longer is the notion of "-noserver".  I did find this post:

    http://www.jetbrains.net/devnet/message/5256919#5256919

I am guessing I will want to start my Tomcat app, then also run GWT debugging in the now-obsolete  "-noserver" mode, so GWT will connect to the afore mentioned Tomcat.

What should I use, in the "GWT Configuration", for "VM Parameters" and "Shell Parameters"?  Or is this approach wrong?

Is there a specific EAP release where this will be made more convenient?

3 comments

I have a workaround I can live with.  The problem is with the GWT dev mode launcher.

I have a Run/Debug configuration with the shell parameters

-noserver -startupUrl "http://localhost:8080/Admin.html?gwt.codesvr=127.0.0.1:9997"

The "Startup URL" shows in the dev mode UI "Launch Default Browser" button.  When I click the "launch" button Internet Explorer just hangs, and the dev mode console says "Unable to launch default browser -- exception: IOException"

However, if I enter the URL directly into the browser address bar it DOES work: my breakpoint in the Java version of the button ClickHandler get's hit as well as the breakpoint in the Tomcat-started server code.

If anyone has more insight into what is going on here I'd love to hear it.

0

-startupUrl parameter is filled by IDEA by using content of "HTML to open" field. Also you shouldn't specify full URL in this parameter. So in your
case you should specify "Admin.html" in "HTML to open" field and remove '-startupUrl' parameter from "Shell parameters" field.

I have a workaround I can live with.  The problem is with the GWT dev mode launcher.

I have a Run/Debug configuration with the shell parameters

-noserver -startupUrl "http://localhost:8080/Admin.html?gwt.codesvr=127.0.0.1:9997"

The "Startup URL" shows in the dev mode UI "Launch Default Browser" button.  When I click the "launch" button Internet Explorer just hangs, and the dev mode console says "Unable to launch default browser -- exception: IOException"

However, if I enter the URL directly into the browser address bar it DOES work: my breakpoint in the Java version of the button ClickHandler get's hit as well as the breakpoint in the Tomcat-started server code.

If anyone has more insight into what is going on here I'd love to hear it.

---
Original message URL: http://www.jetbrains.net/devnet/message/5258556#5258556



--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

Thanks for replying.

It appears my setup is abnormal in some way. Your suggestion results in "IO Error" in the dev mode tool console, and no web page opens.

In my situation, the HTML is served from port 8080 (generated by a Servlet using Velocity) and the "?gwt.codesvr=127.0.0.1:9997" (my theory) is needed by the plug-in to connect back to the dev mode tool.  Unless I use the full URL in the "-startupUrl" in the shell parameters it seems the port 8080 and the query string are stripped off.  I think I got an error message that says as much.  So long as the dev mode tool is running it seems I can debug GWT client code quite well.  I could probably bookmark the URL in my browser and ignore the URL in the GWT Run/Debug settings, but I have not tested this.

While I wish it hadn't take so long to work this out, I am productive again in any case.  I appreciate that you should describe the proper way to use this feature for the benefit of others even if my own particular situation might be unique.

0

Please sign in to leave a comment.