Tevoi Andrea
2012-08-10 08:36:52 UTC
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
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