Notes on Building and Implementing JBoss Profiler for Solaris
The default download does not contain the Solaris binary or the Solaris build script.
Download the JBoss Profiler CVS project into $HOME/jboss-profiler.
You can use CVSGrab if you are behind a firewall. Use the following command:
cvsgrab -url http://cvs.sourceforge.net/viewcvs.py/jboss/jboss-profiler/
Go to the directory $HOME/jboss-profiler/native/solaris
Create a new directory $HOME/jboss-profiler/native/solaris/bin
Add the following lines to the file compile.sh or set the environment before running the command:
JAVA_HOME="<The JAVA Home>" export JAVA_HOME
Make sure g++ is in your path. To test this, type which g++.
Execute the compile.sh file.
When the process is complete, you should find libjbossInspector.so in the $HOME/jboss-profiler/native/solaris/bin directory.
Modify your <jboss-home>/run.sh file to add a LD_LIBRARY_PATH entry. This tells the Java VM where to find the native library. The entry should look something like this:
LD_LIBRARY_PATH=$HOME/jboss-profiler/native/solaris/bin export LD_LIBRARY_PATH
Add the -XrunjbossInspector option to the Java command line as described in $HOME/jboss-profiler/readme.txt.
Now you are ready to start JBoss.
If you see this error, it means that the Java VM could not find the libjbossInspector.so or could not load its dependencies.
Error occurred during initialization of VM Could not find -Xrun library: libjbossInspector.so
If this occurs, check the following:
Make sure your LD_LIBRARY_PATH contains the directory containing the libjbossInspector.so file.
Start the application server using truss and look for any errors:
truss ./run.sh > t.txt 2> t.txt
Then peer at the contents of t.txt.
The Java VM may be finding the libjbossInspector.so file just fine, but cannot locate its dependencies. You may need to determine which libraries the libjbossInspector.so depends on an add their directories to the LD_LIBRARY_PATH. Do this as follows:
Go to $HOME/jboss-profiler/native/solaris/bin
Issue the command ldd libjbossInspector.so
You will see output like this:
$ ldd libjbossInspector.so libstdc++.so.6 => (file not found) libm.so.1 => /usr/lib/libm.so.1 libgcc_s.so.1 => (file not found) libc.so.1 => /usr/lib/libc.so.1 libdl.so.1 => /usr/lib/libdl.so.1 /usr/platform/SUNW,Sun-Fire-V440/lib/libc_psr.so.1
For every entry that says (file not found), find the location of that library and add it to your LD_LIBRARY_PATH.
You can issue a search for libraries like this:
find / -name libstdc++.so.6 -print 2>&-