Spring aop mit java.lang.NoClassDefFoundError
Ich habe ein problem mit aop-config. Hier ist ein Teil meiner spring-xml-config:
<bean id="conLogger" class="com.pomkine.pXMPP.connection_service.ConnectionLogger"/>
<aop:config>
<aop:aspect ref="conLogger">
<aop:pointcut id="connect"
expression= "execution(* com.pomkine.pXMPP.connection_service.connectionManager.connect(..))" />
<aop:after pointcut-ref="connect"
method="connected"/>
</aop:aspect>
</aop:config>
Hier ist meine main-Methode:
public static void main (String [] args) {
ApplicationContext ac = new ClassPathXmlApplicationContext("com/pomkine/pXMPP/connection_service/connection-manager.xml");
connectionManager cm=(connectionManager)ac.getBean("connectionManager");
try {
cm.connect();
cm.disconnect();
} catch (XMPPException e) {
e.printStackTrace();
}
}
Wenn ich runnig es, ich bin immer NoClassDefFoundError exception.
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connect': Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException
Kann nicht herausfinden, was das problem ist. Würde jede Hilfe dankbar.
- mögliche Duplikate von Neu im Frühling - Fehlt AOP Bibliotheken in STS, Hilfe!!!
Du musst angemeldet sein, um einen Kommentar abzugeben.
Diese Frage: Missing-Spring AOP-Bibliotheken in STS scheint-Adresse ein ähnliches problem (fehlende Bibliotheken), auch ein problem in diesem Frühlings-Forums-thread.
Haben Sie die genannten Gläser auf Ihrem classpath?
<dependency> <groupId>cglib</groupId> <artifactId>cglib</artifactId> <version>2.2</version> </dependency> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>1.6.11</version> </dependency>