Sometimes, it is easy to be blind to an obvious use-case.
In this case, I had gotten so 'trained' to Debug a project, that I completely forgotten about how hard it is to attach the debugger to the server when the user does a 'Start in Debug Mode'.
Luckily, someone made it clear and I was able to make the situation a bit better, by exposing a new Server property for servers based on the GlassFish v3 code.
The property, Address to use, starts off undefined. The first time you debug a project or start the server in debug mode, the port is selected, if you haven't defined it already. After the value is set, it remains constant unless you...
- uncheck the 'Address to use' check box
- change the value by hand.
While I was working on this, I discovered something that surprised me. If you start the JPDA debugger with a bogus address (when you are using the socket transport), the JVM and debugger will start. A random port is selected and you can proceed. I like interfaces that are forgiving and try to succeed where I have failed.
I was pretty excited about this at first, but soon realized that I could not leverage this 'forgiveness' in the IDE.