How to debug vertx modules from IntelliJ

578 views
Skip to first unread message

Wojciech Krzystek

unread,
Jun 29, 2014, 10:35:42 AM6/29/14
to ve...@googlegroups.com
Solutions that can be found on the net (https://groups.google.com/d/msg/vertx/4R2aKeBMuNE/pnLoJYfu1hcJ) are bit old and not suitable for whole module.
Ideally solution should work with gradle/maven/sbt(support soon, I hope) project structure.

I don't want to convert the module to a verticle and, what is worse, take care of dependencies and classpath.

Tim Fox

unread,
Jun 29, 2014, 12:02:33 PM6/29/14
to ve...@googlegroups.com
What problem are you having?
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Wojciech Krzystek

unread,
Jun 29, 2014, 1:19:44 PM6/29/14
to ve...@googlegroups.com
Here are the steps I perform:
  1. I have a standard vertx webserver module structured with the gradle template
  2. I create new run configuration in Intellij - "Remote" with port 8080 (the same that the http server is listening on), Intellij advices running the remote process with "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8080"
  3. I build with ./gradle assemble, enter build/ directory and run the module with:
    vertx runmod com.mycompany~mymod~0.1.0-SNAPSHOT -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8080
  4. Next, in IDE, I run in 'Debug' mode the configuration prepared before and set some breakpoints

Unfortunately handling requests doesn't stop at any breakpoint.

Few things I suspect:
  1. The port 8080 is wrong. I don't know how this works exactly, but I think there should be 2 separate sockets: one for communication between the IDE and vertx instance and the other for vertx instance - 'normal' app clients communication.
    When I try to introduce a different port than 8080 in IDE, the configuration reports 'socket closed' when run - looks like vertx instance is ignoring specified JVM switches and doesn't open additional socket.
  2. Sources aren't associated with classes residing in build/mods.

I'm also using Yoke added to the project as the compile phase gradle dependency, but this shouldn't cause the problem.

Jacek Pospychała

unread,
Jun 29, 2014, 2:21:48 PM6/29/14
to ve...@googlegroups.com
you could try with the following:

VERTX_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8080
vertx runmod com.mycompany~mymod~0.1.0-SNAPSHOT

for me it works. Also have a look at vertx - it's well commented bash script.

Jez P

unread,
Jun 29, 2014, 2:25:39 PM6/29/14
to ve...@googlegroups.com
If you've got your webserver listening on 8080, you shouldn't be using 8080 as your remote debug port. 

Wojciech Krzystek

unread,
Jun 29, 2014, 2:36:31 PM6/29/14
to ve...@googlegroups.com
Then applied yours and Jacek's advice, it works


On Sunday, 29 June 2014 20:25:39 UTC+2, Jez P wrote:
If you've got your webserver listening on 8080, you shouldn't be using 8080 as your remote debug port. 

 
just as I suspected ;)

Thanks guys!
Reply all
Reply to author
Forward
0 new messages