IDEA 6.0.4: Steps to start a debugging session with Glassfish V1?

IDEA 6.0.4:

My debugging options are:


When I click on the debug icon, IDEA returns the following message:

ERROR: transport error 202: bind failed: Address already in use
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized

What are the steps to start a debugging session with Glassfish V1?



Comment actions Permalink

Here is more information, I still cannot get this to work.

I can start SJSAS PE 9.0_01 (build b14) in the CLI just fine with:
C:\Sun\AppServer\bin>asadmin start-domain --debug=true domain1*

And then receive this output:

Starting Domain domain1, please wait.
Log redirected to C:\Sun\AppServer\domains\domain1\logs\server.log.
Domain domain1 is ready to receive client requests. Additional services are being started in background.
Domain is running with its configuration and logs at:
Admin Console is available at .
Use the same port for "asadmin" commands.
User web applications are available at these URLs:
Following web-contexts are available:
Standard JMX Clients (like JConsole) can connect to JMXServiceURL:
for domain management purposes.
Domain listens on at least following ports for connections:
Domain is started in debug mode.
A debugger can be attached using:

When I click on the Debug icon inside IntelliJ, I get this message:

"Address localhost:4848 is already in use."

o.k. I understand that.

If SJSAS PE 9.0_01 (build b14) is not started by the CLI, I get this message when I click on the Debug icon inside IntelliJ:

*"Failed to establish connection to the target VM, address:
'', transport: 'socket'"*

Comment actions Permalink

Answered by Serge:

Start the server outside of IDEA from the command line, create the
Remote Run/Debug configuration with the following port 9009.

Comment actions Permalink

I'm still seeing this same problem with IDEA 6.0.5 and Glassfish/Sun Application Servec 9. I tried using a different startup script argument, passing "--debug" on the command line to "asadmin.bat start-domain", and not setting JAVA_OPTS from within IDEA. I can't find any combination of options that doesn't cause the "Address already in use" error. Even if I choose a different debugger port each time, IDEA cannot start up Glassfish properly.

I thought this might have something to do with Glassfish having its own debug configuration. Perhaps IDEA is trying to respecify the debugging settings already present in Glassfish. However, if I turn off debugging in Glassfish and just let IDEA use its JAVA_OPTS configuration, Glassfish doesn't seem to respect the intention to activate the debugging agent. If I turn on debugging in Glassfish, I can see upon startup that Glassfish does try to activate its debugging agent, but runs into this "Address already in use" error.

If the error message is to be trusted, only two scenarios emerge: either no debugging agent gets started and IDEA can't connect, or two debugging agents step on one another somehow (both vying for use of the designated debug port) and IDEA still can't connect to either one of them.

Comment actions Permalink

The way I solved this was starting up Glassfish with debugging as:

./asadmin start-domain --debug=true

I have domain1 as an example, then once I see the successful output from start-up, I get the port number and make a debug connection from within IDEA with that port.

I kept trying to start Glassfish from within IDEA and it doesn't work...

I kept the process seperated and it worked.

Comment actions Permalink

Yes, I do see that starting Glassfish separately does work; I'm able to connect as you describe. However, I want to make sure that someone working on IDEA is looking into this problem, as it's a nicely packaged feature that should work, but clearly doesn't.

I just tried looking for an outstanding JIRA issue related to this problem, but nothing turned up.


Please sign in to leave a comment.