Glassfish Netbeans Attaching to localhost “Connection refused”

Bulldog13

Golden Member
Jul 18, 2002
1,655
1
81
I have no idea why this started happening and because of this I am not sure what to check. Whenever I want to debug some java code now, I get in the debug console:

Attaching to localhost:9009 Connection Refused.

It is glassfish and Netbeans. Now this Chrome connector thing has started appearing. Unfortunately, now it won't stop on any of my breakpoints. Fantastic.

The last thing I was trying to do was move some hibernate config from .hbm.xml to annotations and that ended up being more pain than it was worth.

Does anyone have any ideas on how I can debug this? I have another project in Netbeans and that is suffering from the same problem.
 
Last edited:

Bulldog13

Golden Member
Jul 18, 2002
1,655
1
81
For completeness' sake:

From a coworker:

Open up the glassfish admin console in your browser (http://localhost:4848). Then in the left pane, go to Configurations -> server-config -> JVM Settings. Click on JVM Settings. Then in the right pane, your debug options textbox should have something like this. If the text box is blank, paste this value in there: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9009 If the "Debug" checkbox is not checked, check it. Now click the Save button. Try your netbeans debugger again.

For some reason, it had unchecked itself.