How to debug server side code in Thomas Broyer GWT Maven Plugin

384 views
Skip to first unread message

David

unread,
Sep 25, 2016, 11:59:50 PM9/25/16
to GWT Users
I used Thomas Broyer GWT Maven Plugin to create a maven GWT project from a command and imported into Eclipse 4.6. I can run Jetty and Tomcat and application works fine. But I want to debug server side code. I cannot figure out how to debug server side code. I set up a break point in server side code, but it doesn't stop there.

Thanks,

David

Thomas Broyer

unread,
Sep 26, 2016, 3:20:24 AM9/26/16
to GWT Users


On Monday, September 26, 2016 at 5:59:50 AM UTC+2, David wrote:
I used Thomas Broyer GWT Maven Plugin to create a maven GWT project from a command and imported into Eclipse 4.6. I can run Jetty and Tomcat and application works fine. But I want to debug server side code. I cannot figure out how to debug server side code. I set up a break point in server side code, but it doesn't stop there.

With their respective Maven plugins, Tomcat and Jetty run in the Maven process, so you "just" run Maven in debug mode (either "mvnDebug tomcat7:run" instead of "mvn tomcat7:run"; or "Debug as… → Maven…" from within Eclipse, instead of "Run as… → Maven…")
You can also run the webapp using Eclipse WTP (or whatever it's called) by defining a "Server", without using Maven in this case.

David

unread,
Sep 26, 2016, 7:40:47 AM9/26/16
to GWT Users
Thomas,

Once I run "mvnDebug tomcat7:run -pl *-server -am -Denv=dev" from a command line, I just got the following message:
                                           Listening for transport dt_socket at address: 8000

http://localhost:8080/ is not accessible. I cannot figure it out how to debug my gwt application using Maven.

David

Thomas Broyer

unread,
Sep 26, 2016, 8:44:53 AM9/26/16
to GWT Users

On Monday, September 26, 2016 at 1:40:47 PM UTC+2, David wrote:
Thomas,

Once I run "mvnDebug tomcat7:run -pl *-server -am -Denv=dev" from a command line, I just got the following message:
                                           Listening for transport dt_socket at address: 8000

This tells you on which port you'll attach the Java debugger. From Eclipse, you then create a debug launcher for a "remote application" and select the dt_socket transport and 8000 port. Once the Java debugger is connected, the execution is resumed.
It's actually easier to do a "Debug as… → Maven…" in Eclipse.

David

unread,
Sep 26, 2016, 9:02:37 AM9/26/16
to GWT Users
Thomas,

I am not very familiar with Maven in Eclipse. I use Eclipse 4.6. Once I run "Debug as… → Maven", I see there are a lot of choices such as 
Maven build
Maven build...
Maven clean
Maven generate-sources
Maven install
Maven test.

I cannot figure it out how. Can you give me step-to-step instruction? I am very familiar with how to debug GWT application not using Maven.

Thanks,

David

Thomas Broyer

unread,
Sep 26, 2016, 10:14:06 AM9/26/16
to GWT Users


On Monday, September 26, 2016 at 3:02:37 PM UTC+2, David wrote:
Thomas,

I am not very familiar with Maven in Eclipse. I use Eclipse 4.6. Once I run "Debug as… → Maven", I see there are a lot of choices such as 
Maven build
Maven build...
Maven clean
Maven generate-sources
Maven install
Maven test.

I cannot figure it out how. Can you give me step-to-step instruction?

I don't use Eclipse (any longer), but IIRC, use "Maven build…" here, then in the window that opens you can give your -pl and -am (in the "goals" field, and define the 'env' system property with value 'dev' (or maybe just pass -Denv=dev)
 
I am very familiar with how to debug GWT application not using Maven.

You're not trying to debug a "GWT application" here actually, but a "web application". GWT is an implementation detail of your servlets as far as the server-side is concerned.

David

unread,
Sep 27, 2016, 9:48:33 AM9/27/16
to GWT Users
How do I run mvn gwt:compile? I have to pass moduleName. I don't knew how to pass it. I did some research without success. Please help me.

David
Reply all
Reply to author
Forward
0 new messages