Getting 'shmemBase_attach failed: the system can not find the specified file' when trying to connect to the applet to debug

advertisements

I'm using netbeans 6.1.

I've got the following in my java run time settings:

-agentlib:jdwp=transport=dt_shmem,address=jdbconn,server=y,suspend=n

and the following in the attach dialog in netbeans:

Debugger: JPDA Debugger

Connector: Shared Memory Attach (Attaches by shared memory to other VMs)

Transport: dt_shmem

Name: jdbconn

I got the above settings from the FaqDebuggingAppletRemotely page on the netbeans Wiki.

The applet is in an aspx page (the applet, whcih is signed, is a method of communicating via the client browser to a legacy platform, I'm a C# developer really). I've managed to get the security warning to display which gives me a chance to attach to the applet but whenever I try to attach I see:

Attaching to jdbconn

shmemBase_attach failed: The system cannot find the file specified

in the output window in netbeans.

Any help gratefully received!


When you debug with the shared memory option (transport=dt_shmem), you're using Windows internal shared memory objects to communicate between the debugger and the jvm.

This means that if you're:

a. Not debugging from the same physical machine as your jvm, or

b. Not working on a Windows OS,

You can not debug in this mode.

I'm not sure what would happen if you ran a Window on a VM on a Linux station...Might work and might not.

If both of the above are fine, it would require a deeper investigation to find out the problem, but in the mean time, you could attach with a plain socket.

In the Java run time parameters specify:

-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=y

This tells your jvm to run in debug mode, load the jdwp library, wait for connection to attach in port 8000, and suspend execution until such a connection arrives.

In your IDE set the remote debugger accordingly. I don't know Netbeans, but it would be something like Connector = socket connector, address=8000. When you start your web page, the applet will freeze loading until you connect, and of course you can't connect until it has reached the listening stage.

Good luck!