This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 269464 - Attach debugger to running process with dt_socket transport fails with connection refused
Summary: Attach debugger to running process with dt_socket transport fails with connec...
Status: RESOLVED WORKSFORME
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 8.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-31 03:22 UTC by RonBerliner
Modified: 2017-03-16 12:47 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description RonBerliner 2016-12-31 03:22:41 UTC
Running Anagram Game example project.

Set VM options as:

-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,address=7000,suspend=n -classpath ~/NetBeansProjects/AnagramGame/build/classes com.toy.anagrams.ui.Anagrams

Debug>Attach Debugger item is selected in NetBeans with:

Java Debugger (JPDA)
SocketAttach
dt_socket
BigIA
7000
30000 

as options.

The response in the debugger console is 

Attaching to BigIA:7000
Connection refused.

Running from a terminal window I get:

rberliner@BigIA:~$ java -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,address=7000,suspend=n -classpath ~/NetBeansProjects/AnagramGame/build/classes com.toy.anagrams.ui.Anagrams
Listening for transport dt_socket at address: 7000

In a separate terminal window I get:

rberliner@BigIA:~$ jdb -attach 7000
Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.Throwable
Initializing jdb ...
>

Subsequent commands in the window indicate tme that the debugger is connected and operating.


NetBeans info:
Product Version: NetBeans IDE 8.2 (Build 201609300101)
Updates: NetBeans IDE is updated to version NetBeans 8.2 Patch 1
Java: 1.8.0_111; Java HotSpot(TM) 64-Bit Server VM 25.111-b14

Running Ubuntu 16.04
Comment 1 Martin Entlicher 2017-03-16 12:47:45 UTC
Would it help if you make the Host field empty like you do it with jdb?
Or try to use localhost.
Another option would be to add the host to the address:
address=BigIA:7000

The address should correspond to what you fill in the attach dialog.