by mjtrefethen » Sat May 28, 2005 3:23 pm
I encountered this exact same issue attempting to profile a third party vendor's bootstrapped installation of JBoss running Sun 1.4.2 JRE on Windows 2000. The yjpagent.dll was in the system path and I could execute it via command line, obviously using my logged in user path, but the service account could not locate the dll.
With some quick research on how JVMPI loads the agent I found this note :
"The VM attempts to locate a profiler agent library called myprofiler in Java's library directory:
* On Microsoft Windows, it is [value of java.home property]\bin\myprofiler.dll
* On SPARC/Solaris, it is [value of java.home property]/lib/sparc/libmyprofiler.so
If the library is not found in the Java library directory, the VM continues to search for the library following the normal library search mechanism of the given platform:
* On Microsoft Windows, the VM searches the current directory, Windows system directories, and the directories in the PATH environment variable.
* On Solaris, the VM searches the directories in LD_LIBRARY_PATH. "
Since the second option was obviously not working I added a JAVA_HOME parameter to the system and moved the yjpagent.ini and yjpagent.dll into the java/bin folder. This resolved the issue.