From: Iapetus999 <nu...@jb...> - 2005-07-05 18:21:28
|
Here's my jboss-service.xml file: <?xml version="1.0" encoding="UTF-8"?> | <!-- $Id: jboss-service.xml,v 1.3.2.3 2005/06/19 07:08:07 bill Exp $ --> | | <!-- ===================================================================== --> | <!-- JBoss Server Configuration --> | <!-- ===================================================================== --> | | <server> | | <mbean code="org.jboss.aop.deployment.AspectManagerService" | name="jboss.aop:service=AspectManager"> | <attribute name="EnableLoadtimeWeaving">true</attribute> | <!-- only relevant when EnableLoadtimeWeaving is true. | When transformer is on, every loaded class gets | transformed. If AOP can't find the class, then it | throws an exception. Sometimes, classes may not have | all the classes they reference. So, the Suppressing | is needed. (i.e. Jboss cache in the default configuration --> | <attribute name="SuppressTransformationErrors">false</attribute> | <attribute name="Prune">true</attribute> | <attribute name="Include">org.jboss.test</attribute> | <attribute name="Exclude">org.jboss.</attribute> | <attribute name="Optimized">true</attribute> | <attribute name="Verbose">true</attribute> | </mbean> | | <mbean code="org.jboss.aop.deployment.AspectDeployer" | name="jboss.aop:service=AspectDeployer"> | </mbean> | | </server> | View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3883715#3883715 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3883715 |
From: <bil...@jb...> - 2005-07-05 18:24:58
|
did you set up the pluggable-instrumentor.jar? Doco has more info. View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3883717#3883717 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3883717 |
From: Iapetus999 <nu...@jb...> - 2005-07-05 18:50:29
|
I put it in the /bin directory (JBOSS_HOME/bin) Here is the output of run.bat: JBoss Bootstrap Environment | . | JBOSS_HOME: C:\apps\jboss-4.0.1sp1\bin\\.. | . | JAVA: C:\Program Files\Java\jdk1.5.0_01\bin\java | . | JAVA_OPTS: -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=iapetus:39294,suspend=y,server=n -Dmms.core.config=C:\projects\6\marble\source\config\test-harness -Dprogram.name=run.bat -javaagent:pluggable-instrumentor.jar -Xms128m -Xmx512m | . | CLASSPATH: C:\Program Files\Java\jdk1.5.0_01\lib\tools.jar;C:\apps\jboss-4.0.1sp1\bin\\run.jar | . View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3883721#3883721 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3883721 |
From: <kab...@jb...> - 2005-07-06 09:43:55
|
To use the -javaagent switch, you must use AspectManagerServiceJDK5 as the code for the service. View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3883815#3883815 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3883815 |
From: Iapetus999 <nu...@jb...> - 2005-07-06 16:25:29
|
That did it! :) I didn't see that in the docs anywhere. Also in the jboss-service.xml in the jboss-aop_1.3\jboss-40-install\jboss-aop-jdk50.deployer\META-INF directory it's listed as code="org.jboss.aop.deployment.AspectManagerService" Maybe I just missed the doc somehow. View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3883889#3883889 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3883889 |
From: <kab...@jb...> - 2005-07-06 17:15:50
|
It will be in the docs for 1.3.1, along with some more aggressive comments in jboss-service.xml View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3883895#3883895 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3883895 |
From: robert.schwegler <nu...@jb...> - 2005-07-07 21:05:54
|
It took me many many hours and finally here is the right hint! I'm using JDK5, aop1.3 and 4.0.3RC1. Now as I'm using AspectManagerServiceJDK50, I see much more information in the log, but I'm looking for an example with the JBoss Server. Are there any tricks with the class-loader? I wrote an XMBean and deployed it in a sar-directory: package xmbeanprimer; | import xmbeanprimer.Traceable; | import xmbeanprimer.Billable; | public class Greeter { | private int greetingsSent = 0; | @Billable | public String hello() { | this.setGreetingsSent(this.greetingsSent+1); | return "Hello World (" + this.greetingsSent + ")!"; | } | public int getGreetingsSent() { | return this.greetingsSent; | } | public void setGreetingsSent(int c) { | this.greetingsSent = c; | } | } I wrote an aspect and put it in a jar called: adp.aop with an advice: ... | @Bind (pointcut="execution(java.lang.String xmbeanprimer.Greeter->@Billable( | ))") | public Object methodAdvice(MethodInvocation invocation) throws Throwable { | ... My BillingAdvice got deployed: 22:47:52,119 INFO [STDOUT] [debug] Looking for aspects in: adp.BillingAdvice | 22:47:52,139 INFO [STDOUT] [debug] Found @Aspect in: adp.BillingAdvice | 22:47:52,249 INFO [STDOUT] [trying to transform] $Proxy54 | 22:47:52,249 INFO [STDOUT] [debug] There are no caller pointcuts! | 22:47:52,259 INFO [STDOUT] [debug] was $Proxy54 converted: false | 22:47:52,419 INFO [STDOUT] [trying to transform] $Proxy55 | 22:47:52,419 INFO [STDOUT] [debug] There are no caller pointcuts! | 22:47:52,429 INFO [STDOUT] [debug] was $Proxy55 converted: false | 22:47:52,549 INFO [AspectDeployer] Deployed AOP: file:/D:/bin/jboss/jboss-4.0.3RC1/server/default/deploy/adp.aop But my Advice is not found: 22:47:54,913 INFO [STDOUT] method matched binding execution(* *->@xmbeanprimer.Billable(..)) public java.lang.String xmbeanprimer.Greeter.hello() | 22:47:54,913 INFO [STDOUT] [debug] added advisor: xmbeanprimer.Greeter from binding: jar:file:/D:/bin/jboss/jboss-4.0.3RC1/server/default/tmp/deploy/tmp51167adp.aop!/META-INF/jboss-aop.xml0 | 22:47:54,993 ERROR [MainDeployer] Could not create deployment: file:/D:/bin/jboss/jboss-4.0.3RC1/server/default/deploy/greeter01.sar/ | org.jboss.deployment.DeploymentException: java.lang.ClassNotFoundException: No ClassLoaders found for: adp.BillableInterceptor; - nested throwable: (java.lang.RuntimeException: java.lang.ClassNotFoundException: No ClassLoaders found for: adp.BillableInterceptor) Thanks for any hints how to package it cleanly. My target is to do runtime weaving! I checked the examples but all of them compile all the files in one directory. Have I overseen an example? Regards Robert Schwegler, Amadeus View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3884098#3884098 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3884098 |
From: <kab...@jb...> - 2005-07-07 21:11:05
|
There is an example called "injboss" which does loadtime weaving in jboss. Make sure that you add org.jboss.injbossaop to the "Include" attribute of the aspect manager service View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3884101#3884101 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3884101 |