Trying again to post the pointcut declaration :
<bind pointcut="all(@transactional)"> <interceptor class="org.smcp.twister.engine.common.aspect.TransactionInterceptor"/> </bind>
Did you look at the metadata example that comes with JBoss AOP beta1? You have to run that generates another XML file. Then you must have that XML file and your binding in the jboss.aop.path System property.
If you change to have report="true" then you can get an XML dump of bindings and metadata attached. You can get the same thing graphically through the JBoss management console if you're running within JBoss.
Get back to me if you have more problems.
Sorry about that, metadata-aop.xml was not in jboss.aop.path. Absolutely my fault.
Thinking about it this property bothers me a bit as in most deployment you don't have a prior knowledge of the file system. Is there a way to make JBossAOP just look in the classpath (like loading it using a classLoader.getResourceAsStream()) ??
Thanks a lot.
Depends if you are running inside or outside the JBoss application server.
If outside, then JBoss AOP does this by default:
Enumeration enum = Thread.currentThread().getContextClassLoader().getResources("META-INF/jboss-aop.xml");
So any part of your classpath that has a META-INF/jboss-aop.xml file within it will be loaded by JBoss AOP. See the packaging tutorial example for more detail.
If you are running inside JBoss applications server, this "getResources" feature is turned off. Instead, you must put YOURFILE-aop.xml in the deploy directory, or create a jar named YOURJAR.aop and in the META-INF directory of the YOURJAR.aop jarfile put a jboss-aop.xml. Am I making sense? I will write a "Using within JBoss app server" example for the next release.
I'm running outised the app server and my jboss-aop.xml is properly loaded from the META-INF directory but not the metadata-aop.xml. It seems that the metadata file only gets propery loaded using the jboss.aop.path, is that right ?
Been asked by Bill to let you know he is away giving training. He'll respond eventually, but not as quickly as normal.
Yes, that is correct, please see the packaging example though.