Sorry, typo... 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Buck, Robert
Sent: Monday, July 21, 2008 1:48 PM
To: [email protected]
Subject: [aspectj-users] problems running in jboss only: aop concrete
aspectextending abstract aspect extending ordinary abstract base class

Hi,

I am having a problem when deploying aspects having abstract
base-classes into jboss

Here are three 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 (**FAILS**):

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 (**WORKS**) :

Change the aspect slightly... Remove the "extends Base" and comment out
the "super.*(jp)" calls. Rerun jboss, and it works properly.
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to