CyberwolfXXL
Grünschnabel
Hallo ,
ich versuche mich gerade in AOP einzuarbeiten. Gibt es ein funktionierendes Beispiel, wie man einen Aspect per DI definieren kann?
Ich verwende Eclipse 3.3 und bekomme bei meinen Test immer einen Fehler.
Kann mir da vielleicht einer helfen?
Danke im Voraus.
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [aopASpectJ/context2.xml]; nested exception is java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException
ich versuche mich gerade in AOP einzuarbeiten. Gibt es ein funktionierendes Beispiel, wie man einen Aspect per DI definieren kann?
Ich verwende Eclipse 3.3 und bekomme bei meinen Test immer einen Fehler.
Kann mir da vielleicht einer helfen?
Danke im Voraus.
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [aopASpectJ/context2.xml]; nested exception is java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException
XML:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<bean id="HalloWelt" class="aopASpectJ.HalloWelt" />
<aop:config>
<aop:aspect ref="helloFromSpringAOP">
<aop:pointcut id="mainMethod"
expression="execution(* main(..))" />
<aop:after-returning pointcut-ref="mainMethod"
method="sayBye" />
</aop:aspect>
</aop:config>
<!-- andere Beans -->
</beans>
Zuletzt bearbeitet von einem Moderator: