GlassFish V3 profiling
By binu on Apr 01, 2009
I have been using JProfiler and BTrace for the performance analysis of GlassFish V3. Things were working well until I picked up build 42 last week. With this build, I was unable to attach BTrace or the profiler (I haven't checked whether the latest version of JProfiler fixes this problem). The server throws a NoClassDefFoundError while loading the BTrace script as shown in the sample below. A similar exception is thrown while trying to load com.jprofiler.\* classes.
This is due to changes made in the Felix's bootdelegation. Snippets from the configuration file, felix/conf/config.properties for build 40 and 42 are shown below.
build 40: org.osgi.framework.bootdelegation=\*
build 42: org.osgi.framework.bootdelegation=org.xml.sax.\*, org.w3c.\*, javax.\*
Peter Kriens has a good blog, A Strong Lesson About Modularity, that describes bootdelegation, I suggest you check it out.
In order to get Jprofiler and BTrace to work, I had to modify the configuration file (thanks Jerome for the pointer) as follows -
org.osgi.framework.bootdelegation=org.xml.sax.\*, org.w3c.\*, javax.\*, com.jprofiler.\*, com.sun.btrace.\*
Once this change was made, I was able to get the profilers working.