Red Hat Bugzilla – Bug 137027
BEA Java Run Time Analyzer not working with jonas
Last modified: 2007-04-18 13:14:16 EDT
Description of problem:
the JRA doesn't work, and comes back with error message:
[JRockit] New Management Server connection from host-41.support.localnet
[JRockit] Error opening JRA recording file: jrarecording.xml
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Launch jonas with the java options "-Xmanagement"
2. On the console, launch /usr/lib/jvm/java-1.4.2-bea-1.4.2.04/bin/console
3. and try to connect
Error message that it can't write to the log file
It can write the log file
The problem is because JRockit will try to write to the $CWD of the
jonas process rather than its home directory. Jonas should cwd to its
home directory better starting:
$ ls -ld /proc/`pidof java`/cwd
lrwxrwxrwx 1 jonas jonas 0 Oct 25 11:29 /proc/3053/cwd
Could you please specify how jonas is launched, and how/where the java
options "-Xmanagement" is specified?
RHAPS comes with a service script, and the recommended way to start
jonas is by using the service script, eg. service jonas start. To
specify the -Xmanagement option when starting jonas with the service
script, we would recommend adding the option in the /etc/sysconfig/jonas.
I've tried the above setting and it seems to be working fine.
The problem isn't with the way Jonas is started per se. The problem is
that the JVM will have a non-writable cwd, and that BEA JRockit is
very stupid and uses that cwd as a temp directory.
Adding a "cd /usr/share/jonas/work" in the init script before
jonas/the JVM is launched should be enough to allow jonas to write to
its current dir.
When using the BEA Java Run Time Analyzer to do JRA recording, there's
an option to specify where the file goes in the JRA Recording dialog,
by specifying /tmp/jrarecording.xml, the recording will go fine.