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中加入依赖信息
Xml代码   收藏代码
  1. <dependency>  
  2.        <groupId> org.aspectjgroupId >  
  3.        <artifactId> aspectjweaverartifactId >  
  4.        <version> 1.6.11version >  
  5. dependency>  

你可能感兴趣的:(JavaWeb)