[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[aspectj-users] problems running in jboss only: aop concrete aspect extending abstract aspect extending ordinary abstract base class
|
Hi,
I am having a problem when deploying aspects having abstract
base-classes into jboss
Here is a pair of use cases that I run into problems with...
An abstract aspect is referenced in an aop.xml file:
<concrete-aspect name="$com.sun.ebank.DukesBank$Aspect"
extends="com.verisign.aspectj.j2ee.tutorial.ebank.SimpleAspect">
<pointcut name="scope" expression="execution(*
com.sun.ebank..*.*(..)) || execution(*.new(..))"/>
</concrete-aspect>
And SimpleAspect itself extends an abstract base class that provides
utility functions which @Before and @After methods use.
@Aspect
public abstract class SimpleAspect extends
AnOrdinaryAbstractBaseClass {
@Pointcut
public abstract void scope();
@Before("scope()")
public void before(JoinPoint jp) {
super.before(jp);
System.out.println("before: " +
jp.getStaticPart().getSignature().getDeclaringTypeName());
}
@After("scope()")
public void after(JoinPoint jp) {
super.after(jp);
System.out.println("after: " +
jp.getStaticPart().getSignature().getDeclaringTypeName());
}
}
Case 1 (works):
Run "junit" code that triggers the aspect to be run; you get the
expected "before/after" output.
Case 2 (works):
Run the DukesBank demo application within jboss, which triggers the
aspect. The aspect and the aop.xml file is located inside a jar placed
in the jboss/server/default/lib directory. You get exceptions being
thrown from:
public static DukesBank$Aspect aspectOf()
{
if(ajc$perSingletonInstance == null)
throw new
NoAspectBoundException("$com.sun.ebank.DukesBank$Aspect",
ajc$initFailureCause);
else
return ajc$perSingletonInstance;
}
Case 3 (fails) :
Change the aspect slightly... Remove the "extends Base" and comment out
the "super.*(jp)" calls. Rerun jboss, and it works properly.