dev@glassfish.java.net

NetBeans profiler cannot connect to b54; b59 is OK

From: Tim Quinn <Timothy.Quinn_at_Sun.COM>
Date: Thu, 13 Aug 2009 11:43:28 -0500

Hi.

We are looking into performance differences between b54 and later
builds. The NetBeans profiler cannot connect to the server from
promoted b54. I can connect dynamically just fine to b59 (and I think
b58 which I tried earlier).

This is on Mac OS X running Java 1.6.0-15 and NB 6.7.1.

The interesting part of the IDE log is:

Caused by: com.sun.tools.attach.AttachNotSupportedException: Unable to
open socket file: target process not responding or HotSpot VM not loaded
        at
sun.tools.attach.MacosxVirtualMachine.<init>(MacosxVirtualMachine.java:82)
        at
sun.tools.attach.MacosxAttachProvider.attachVirtualMachine(MacosxAttachProvider.java:34)
        at
com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:195)
        ... 9 more

This is using the "dynamic" method of attachment in which no special
config is needed for the target VM (supposedly!).

When I try to use "direct" attachment instead (which involves setting
jvm-options in the domain.xml) the server stalls, correctly, during
"asadmin start-domain --verbose" then once I connect from the NB
"attach" dialog the server displays the output below. As a quick hack
I've tried slapping the NetBeans JAR which contains that class onto the
end of the boot class path hoping that would solve this, but no luck.

Does anyone know how b54 might differ from more recent builds, in Felix
or elsewhere the server, that would explain the difference?

And, more importantly, does anyone have any suggestions for how to make
this work with b54?

Thanks.

- Tim

-- Output from the server during "asadmin start-domain --verbose"

Profiler Agent: Waiting for connection on port 5140 (Protocol version: 9)

[ then I attach from NetBeans ]

Profiler Agent: Established local connection with the tool
Aug 13, 2009 11:33:39 AM com.sun.enterprise.glassfish.bootstrap.ASMain main
INFO: Launching GlassFish on Felix platform

Welcome to Felix.
=================

ERROR: Error starting
file:/Users/Tim/asgroup/v3/b54/publish/glassfishv3/glassfish/modules/osgi-main.jar
(org.osgi.framework.BundleException: Activator start error in bundle
com.sun.enterprise.osgi-main [1].)
java.lang.NoClassDefFoundError:
org/netbeans/lib/profiler/server/ProfilerRuntimeCPUFullInstr
    at org.jvnet.hk2.osgimain.Main.<clinit>(Main.java:79)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at java.lang.Class.newInstance0(Class.java:355)
    at java.lang.Class.newInstance(Class.java:308)
    at
org.apache.felix.framework.Felix.createBundleActivator(Felix.java:3367)
    at org.apache.felix.framework.Felix.startBundle(Felix.java:1465)
    at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:988)
    at
org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:267)
    at java.lang.Thread.run(Thread.java:637)