Rick

Rick
Rick

Wednesday, February 3, 2010

Using NetBean's profiler with JBoss

I am trying to configure NetBeans 6.8 with JBoss 4.0.5 running on JDK 1.5.

These instructions are only valid for NetBean's 5.5... (http://profiler.netbeans.org/docs/help/5.5/j2ee_server_integration.html(view on Google Sidewiki)) Where are the instructions for NetBean's 6.8?


The instructions state the following:

For JDK 5/6, add the following single line
set JAVA_OPTS=
-agentpath:%PROFILER_LIBS%\deployed\jdk15\windows\profilerinterface.dll=
%PROFILER_LIBS%,%AGENT_PORT% %JAVA_OPTS%

The profiler lib is no longer under modules/profiler1... you can find it as follows:

I found it well enough.

PROFILER_LIB=/home/corventis/netbeans-6.8/profiler3/lib
AGENT_PORT=7676

JAVA_OPTS="-Dprogram.name=$PROGNAME -Dcom.sun.management.jmxremote $JAVA_OPTS"

JAVA_OPTS="-agentpath:$PROFILER_LIBS/deployed/jdk15/linux/libprofilerinterface.so=$PROFILER_LIBS,$AGENT_PORT $JAVA_OPTS"

Ok.. that did not work...


I changed JAVA_OPTS as follows:

JAVA_OPTS="-agentpath:/home/corventis/netbeans-6.8/profiler3/lib/deployed/jdk15/linux/libprofilerinterface.so=$PROFILER_LIBS,7676 $JAVA_OPTS"

Now I get... Exception Profiler Agent Warning: Native bind failed to lookup org.netbeans.lib.profiler.server.ProfilerRuntimeMemory class!!!

I guess this is progress. It now says it can't find the jar files.

So looking up the above error message gives me this...

http://forums.netbeans.org/topic5938.html

This seems to have the answer.

"""
Where did you get this commandline? It is incorrect. It should be:

/usr/lib/jvm/java-1.5.0-sun/bin/java -agentpath:/usr/local/netbeans/
profiler3/lib/deployed/jdk15/linux/libprofilerinterface.so -
Xbootclasspath/a:/usr/local/netbeans/profiler3/lib/jfluid-
server-15.jar:/usr/local/netbeans/profiler3/lib/jfluid-server.jar
org.netbeans.lib.profiler.server.ProfilerServer /usr/local/netbeans/
profiler3/lib/deployed/jdk15/linux 5141 10 ____Profiler+Calibration
+Run____
"""

Ok......
So now I try this....

JAVA_OPTS="-Dprogram.name=$PROGNAME -Dcom.sun.management.jmxremote $JAVA_OPTS"
JAVA_OPTS="-agentpath:/home/corventis/netbeans-6.8/profiler3/lib/deployed/jdk15/linux/libprofilerinterface.so=$PROFILER_LIBS,7676 -Xbootclasspath/a:/home/corventis/netbeans-6.8/profiler3/lib/jfluid-server-15.jar:/home/corventis/netbeans-6.8/profiler3/lib/jfluid-server.jar $JAVA_OPTS"

And I get this...

java.lang.UnsatisfiedLinkError: Can't load library: /deployed/jdk15/linux/libprofilerinterface.so
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1650)
at java.lang.Runtime.load0(Runtime.java:769)
at java.lang.System.load(System.java:968)
at org.netbeans.lib.profiler.server.ProfilerServer.loadNativeLibrary(ProfilerServer.java:818)
at org.netbeans.lib.profiler.server.ProfilerServer.doActivate(ProfilerServer.java:873)
at org.netbeans.lib.profiler.server.ProfilerServer.activate(ProfilerServer.java:511)
profile.sh: unused non-option argument: default
14:45:02,768 INFO [Server] Starting JBoss (MX MicroKernel)...

Not sure why iin reference to: http://profiler.netbeans.org/docs/help/5.5/j2ee_server_integration.html (view on Google Sidewiki)

Kafka and Cassandra support, training for AWS EC2 Cassandra 3.0 Training