I downloaded version 1.6.0 of byteman and tried to follow some of the steps from the byteman tutorial at http://community.jboss.org/wiki/ABytemanTutorial but ran into a couple of issues
1. I had some weblogic server processes running on our linux machines and I wanted to start an agent using the bmsubmit script. I ran the bminstall script with the pid of the weblogic server as the port:
./bminstall.sh 8249 ( 8249 is the pid of the weblogic server process)
I expected this command to start a agent listener but the command would just sit there and do nothing. I checked the weblogic server logs and there was nothing in it. In the tutorial, it was stated that bminstall might work with JRockit JVM but apparently it is not working.
2. With no success using bminstall, I had to fall back to the hard way and add -javaagent option to my weblogic server and bounce it.
( I noticed that if port option is used with out setting the listener option to true, it was not starting a listener. Documentation says that setting a value to the port implicitly sets the listener to true but I didn't see that happen)
Using netstat command, I verified that the listener was started.
I then wrote a simple byteman script that throws an exception in one of the methods and submitted using the bmsubmit command:
bmsubmit.sh -p 8904 -l throw.btm
This command worked fine. My code starting throwing exceptions at the specified location in the btm.
Next, I attempted to unload the files using -u option:
bmsubmit.sh -p 8904 -u throw.btm
This command caused the server process to throw an error which was captured in the weblogic logs:
exception in thread "Thread-0" java.lang.ClassFormatError
at sun.instrument.InstrumentationImpl.retransformClasses0(Native Method)
I would appreciate if you can look into this issue. I am very excited about using byteman for putting our code through various exception scenarios. It would a great tool for such kind of testing.
My Platform details:
OS: Redhat AS 4. 5 ( Red Hat Enterprise Linux AS release 4 (Nahant Update 5)
JVM : Jrockit JVM 188.8.131.52
java version "1.6.0_05"
Java(TM) SE Runtime Environment (build 1.6.0_05-b13)
BEA JRockit(R) (build R27.6.0-50_o-100423-1.6.0_05-20080626-2104-linux-ia32, compiled mode)
Byteman Version: 1.6.0