Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Using Aspects.aspectOf for Spring DI

Hi all,

 

I developed an Aspect library with @AspectJ syntax and I use it via CTW to weave an application. I know that because I used java compiler, aspectOf and hasAspect are not generated, so I tried to use Aspects utility class to instantiate Aspect classes in Spring.

 

Here is the Spring xml fragment:

<bean class="org.aspectj.lang.Aspects" id="outputMessageLogger" factory-method="aspectOf">

    <constructor-arg type="java.lang.Class" value="logging.OutputMessageLoggerAspect "/>

...

 

During startup this exception is thrown:

Factory method [public static java.lang.Object org.aspectj.lang.Aspects.aspectOf(java.lang.Class) throws org.aspectj.lang.NoAspectBoundException] threw exception; nested exception is org.aspectj.lang.NoAspectBoundException: Exception while initializing logging.OutputMessageLoggerAspect: java.lang.NoSuchMethodException: com.cadit.xas.aop.logging.OutputMessageLoggerAspect.aspectOf()

 

Is there something wrong in the way I use Aspects utility class?

 

Many thanks in advance,

Andrea


Back to the top