[jboss-user] [JBoss AOP] New message: "Re: Tried everything to get Interceptor working, what am I missing?"
Nick Dodd
do-not-reply at jboss.com
Mon Feb 1 11:29:57 EST 2010
User development,
A new message was posted in the thread "Tried everything to get Interceptor working, what am I missing?":
http://community.jboss.org/message/523411#523411
Author : Nick Dodd
Profile : http://community.jboss.org/people/baronDodd
Message:
--------------------------------------------------------------
Ok thanks. Sorry for my naivety on this subject, going to learn all about this in a course later in the year but trying to implement it for a quick bug fix! My plan may have been flawed from the very start. What I ultimately want to do is intercept calls to all invocations of java.ejb.SessionContext.getCallerPrincipal() which could be any number of concrete classes at runtime in several jar files. So precompilation will not be an option.
I got my test working the same as before but this time with the annotations:
@InterceptorDef(scope=Scope.PER_VM)
@Bind (pointcut="execution(public * *->*(..))")
Same result as before, only picking up the jms classes. If I am specifying my bindings in annotations, can I get away with an empty *-aop.xml? Also as this is not a war/ear deployment it can simply sit alongside my jar file? I am intercepting the jms classes even without xml.
Anyhow, I realized that I had not used the proper command line argument for loadtime:
-javaagent:$(JBossHome)/server/deploy/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar
Added this and suddenly lots of NoClassDefFounds. Added the jdk50.deployer jars to the classpath and suddenly it sparked into live and I got a stackoverflow from my interceptor intercepting itself to infinity! This is what I had been waiting for! Changed the pointcut expression to something more sensible, and now I get :
java.lang.NoClassDefFoundError: org/jboss/dom4j/Element
Which appears to be in a ridiculously named dom4j-jarjar.jar in the 3rd party libs which JBoss is built against...
Think this is starting to suck through too many changes for a quick fix.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/523411#523411
More information about the jboss-user
mailing list