-
1. Re: Aspect available for all applications - configuration, j
kabirkhan Oct 4, 2005 3:03 PM (in response to adamw)1) If you use compile-time weaving you can cut down on the config necessary
2) As far as I can remember, the jrockit transformer is supposed to work with both JDK versions. Did you get any errors when trying it out, and did you follow the steps in the reference guide? -
2. Re: Aspect available for all applications - configuration, j
adamw Oct 5, 2005 9:18 AM (in response to adamw)1. Yes, I thought about that, just run-time weaving is much cooler and doesn't require to compile everything using aopc :).
2. Is there any additional configuration for jrockit needed? I copied jrockit-pluggable-instrumetor.jar into the bin directory, and added:
JAVA_OPTS="$JAVA_OPTS -javaagent:jrockit-pluggable-instrumentor.jar"
to run.conf. When I run, I get the following error:
java.lang.ClassNotFoundException: org.jboss.aop.standalone.Agent
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(Ljava.lang.String;Z)Ljava.lang.Class;(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:133)
The application has requested the JVM to exit with an fatal error from JNI. Error message:
processing of -javaagent failed.
If I switch to pluggable-instrumentor.jar and sun's jdk it works. -
3. Re: Aspect available for all applications - configuration, j
kabirkhan Oct 5, 2005 9:35 AM (in response to adamw)I'm afraid the jrockit jvm takes another set of switches
Standalone:$ java -cp=<classpath as described above> -Djboss.aop.path=<path to jboss-aop.xml> \ -Xmanagement:class=org.jboss.aop.hook.JRockitClassPreProcessor com.blah.MyMainClass
In JBoss:
modify run.sh:# Setup JBoss sepecific properties JAVA_OPTS="$JAVA_OPTS -Dprogram.name=$PROGNAME \ -Xmanagement:class=org.jboss.aop.hook.JRockitPluggableClassPreProcessor" JBOSS_CLASSPATH="$JBOSS_CLASSPATH:jrockit-pluggable-instrumentor.jar"
jboss-service.xml<mbean code="org.jboss.aop.deployment.AspectManagerService" name="jboss.aop:service=AspectManager"> ... </mbean>
-
4. Re: Aspect available for all applications - configuration, j
adamw Oct 5, 2005 4:01 PM (in response to adamw)Hello,
thank you very much for the answers, it worked. However, I also, quite accidentaly, ran the "sun jdk" setup (that is, code="org.jboss.aop.deployment.AspectManagerServiceJDK5", -javaagent=pluggable-instrumentor.jar) with jrockit and it works! I even restarted the computer to check but still, everything is ok, with both jdks :)
The first time I tried it two days ago I got some error with libinstrument.so. Maybe I did something different then too.
--
Adam