I am trying to connect my best debugger to a remote Glassfish instance (empty, I do not mean to work on one physical machine, and not just on the same virtual machine).
The domain configuration in the glass box has the "debug" flag, and server.log reports during startup
-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9009
Which indicates (in my opinion), debugging is really enabled.
However, when I try to connect a debugger, it fails. The following example is an example (performed using PuTTy):
$ jdb -connect com.sun.jdi.SocketAttach:port=9009
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:385)
at java.net.Socket.connect(Socket.java:529)
at com.sun.tools.jdi.SocketTransportService.attach(SocketTransportService.java:204)
at com.sun.tools.jdi.GenericAttachingConnector.attach(GenericAttachingConnector.java:98)
at com.sun.tools.jdi.SocketAttachingConnector.attach(SocketAttachingConnector.java:72)
at com.sun.tools.example.debug.tty.VMConnection.attachTarget(VMConnection.java:358)
at com.sun.tools.example.debug.tty.VMConnection.open(VMConnection.java:168)
at com.sun.tools.example.debug.tty.Env.init(Env.java:64)
at com.sun.tools.example.debug.tty.TTY.main(TTY.java:1010)
Fatal error:
Unable to attach to target VM.
What can cause this behavior?
EDIT
Please note that this jdb command was indicated as an example of testing Glassfish debugging on the Internet , which is why I used it
, jdb ( PuTTy, jdb Glassifh ).