java.lang.NoClassDefFoundError: org/aspectj/weaver/BCException

在项目中使用了Spring管理和配置事务,在启动tomcat时报错:nested exception is java.lang.NoClassDefFoundError: org/aspectj/weaver/BCException
具体报错信息如下:
Error creating bean with name 'c3p0' defined in class path resource [config/spring/spring-pool.xml]: BeanPostProcessor before instantiation of bean failed; nested exception is  org.springframework.beans.factory.BeanCreationException  : Error creating bean with name 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0': Cannot resolve reference to bean 'ermPoincCut' while setting bean property 'pointcut'; nested exception is  org.springframework.beans.factory.BeanCreationException  : Error creating bean with name 'ermPoincCut': Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError:  org/aspectj/weaver/BCException

原因:是由于classpath下缺少了aspectjweaver.jar的缘故。
解决办法:在pom.xml中加入依赖信息
<dependency>
       <groupId> org.aspectj</groupId >
       <artifactId> aspectjweaver</artifactId >
       <version> 1.6.11</version >
</dependency>
 

你可能感兴趣的:(exception,事务,异常,aspectjweaver)