[jboss-user] [JBoss AOP] - AOP packaging for LoadTime weaving with EAR isolation
ortimus
do-not-reply at jboss.com
Thu Jul 20 19:23:03 EDT 2006
We have an issue with loadtime weaving due to EAR isolation.
Our environment is: JBoss 4.0.3 + JBOSS AOP 1.5 GA
Here's the scenario:
We have a jar myaspects.aop with the following structure:
myaspects.aop
com
|__aoptest
|__aspects
| |__ MyException
|__interceptors
| |__MyInterceptor
|__META_INF
|__jboss-aop.xml
MyInterceptor is bound to the MyException constructor
jboss-aop.xml:
<?xml version="1.0" encoding="UTF-8"?>
| <aop>
| <bind pointcut="execution(public com.aoptest.aspects.MyException->new())">
| <interceptor class="com.aoptest.interceptors.JeopardyInterceptor" scope="PER_VM"/>
| </bind>
| </aop>
We have say two EAR's - componentX & componentY - with EAR isolation turned on. Both componentX & componentY include myaspects.aop.
componentXSession is a stateless session bean in componentX
componentYSession is a stateless session bean in componentY
componentXSession has a method fooX
fooX(){
...
throw new com.aoptest.aspects.MyException();
...
}
componentYSession has a method fooY
fooY(){
...
throw new com.aoptest.aspects.MyException();
...
}
If we call componentXSession.fooX or componentYSession.fooY() independently, the intercptor gets invoked correctly for each call.
Now, say componentXSession has a method fooXY
fooXY(){
...
fooX()
...
componentYSession.fooY()
...
}
In this secnario, where we are calling a method on another sessiopn bean (in another EAR) the intercptor doesn't get invoked.
So, from fooXY, MyException created by fooX() gets intercepted, but MyException created by componentYSession.fooY() doesn't get intercepted.
Is this correct behavior with EAR isolation turned on?
If we turn EAR isolation off for both the EARs, this cross-EAR call works (now we have the problem of multiple invocations on each call but that is another issue.)
In our project we have decided to use EAR isolation ON, so we need guidance on how to make this work.
Should I be using a different packaging scheme or configuration that will make this work? Any advice will be appreciated.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959736#3959736
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959736
More information about the jboss-user
mailing list