Maven debug port and service locator port conflict

546 views
Skip to first unread message

James Roper

unread,
Nov 12, 2016, 6:00:48 PM11/12/16
to Lagom Framework Users
Hi all,

Just looking at debugging Lagom when using Maven.  Lagom runs services in the same JVM as the build tool, so to debug Lagom services in Lagom, you simply start Maven in debug mode.  Maven provides a convenient script for starting it in debug mode, mvnDebug.  The problem is, the debug port in that script is hard coded to 8000, which conflicts with the Lagom service locator port.  Here are some options that we could take to solve this:

* Do nothing. Document how to start Maven in debug mode without using mvnDebug, which is done by doing this on *nix systems:

env MAVEN_DEBUG_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5555" mvn

* Change the default service locator port in maven (and maybe also sbt) to something else (maybe 8001).
* Create a script, similar to mvnDebug, that the lagom maven archetype generates, that uses a different (and configurable) debug port.

Any thoughts about which option we should take?

Cheers,

James

--
James Roper
Software Engineer

Lightbend – Build reactive apps!
Twitter: @jroper

Tim Moore

unread,
Nov 12, 2016, 7:50:34 PM11/12/16
to James Roper, Lagom Framework Users
I think I prefer option 2 (changing the port used by the service locator), since the whole premise of offering Maven support is that many developers are already familiar with it and don't want to change habits.

Ports 8000, 8001, 8080 are common defaults for a lot of development web servers, too... maybe staying away from that range is best. 7000? 9001?

I've been thinking it would be a good idea for us to document how to attach a debugger to services in development, in any case. What's the best practice for sbt? Passing -J options to it?


-- Tim

--
You received this message because you are subscribed to the Google Groups "Lagom Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lagom-framework+unsubscribe@googlegroups.com.
To post to this group, send email to lagom-framework@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lagom-framework/CABY0rKM_Gi5gFY7iGV9HOzh%3D6bb%2BqDJkk3Dod6Ni9KppDNXOqQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Tim Moore
Senior Engineer, Lagom, Lightbend, Inc.


James Roper

unread,
Nov 13, 2016, 10:46:10 PM11/13/16
to Tim Moore, Lagom Framework Users
sbt has a -jvm-debug option that allows you to pass a port number.
Reply all
Reply to author
Forward
0 new messages