jdb fails to connect to running java application over sockets
I'm trying to use jdb to connect to a running instance of a java program.
If I use dt_shmem:
> java -agentlib:jdwp=transport=dt_shmem,address=shmem,server=y,suspend=n JDBTest
>jdb -attach shmem
Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.Throwable
Initializing jdb ...
> quit
works fine.
If I use dt_socket, jdb crashes:
> java -agentlib:jdwp=transport=dt_socket,address=9000,server=y,suspend=n JDBTest
P:\workspace\JDBTest>jdb -attach 9000
java.io.IOException: shmemBase_attach failed: The system cannot find the file specified
at com.sun.tools.jdi.SharedMemoryTransportService.attach0(Native Method)
at com.sun.tools.jdi.SharedMemoryTransportService.attach(SharedMemoryTra
nsportService.java:90)
at com.sun.tools.jdi.GenericAttachingConnector.attach(GenericAttachingCo
nnector.java:98)
at com.sun.tools.jdi.SharedMemoryAttachingConnector.attach(SharedMemoryA
ttachingConnector.java:45)
at com.sun.tools.example.debug.tty.VMConnection.attachTarget(VMConnectio
n.java:358)
at com.sun.tools.example.debug.tty.VMConnection.open(VMConnection.java:1
68)
at com.sun.tools.example.debug.tty.Env.init(Env.java:63)
at com.sun.tools.example.debug.tty.TTY.main(TTY.java:964)
Fatal error:
Unable to attach to target VM.
It looks like jdb is trying to connect over shared memory instead of using sockets.
Trying jdb -attach localhost:9000 has the same effect.
I can however connect to the running Java program using the Eclipse debugger using a remote configuration.
What can I do that jdb will use sockets?
I'm using Windows 2000 SP4 and Java 1.5.0_07.
Many thanks in advance
Thomas

