解决java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor问题

hibernate整合spring当在spring配置文件中加入如下代码

<!--2.配置事务属性,需要事务管理器-->
       <tx:advice id="txAdvice" transaction-manager="transactionManager">
           <tx:attributes>
               <tx:method name="get*" read-only="true"/>
               <tx:method name="*"/>
           </tx:attributes>
       </tx:advice>
       <!--3.配置事务切点,并把切点和事务属性关联起来-->
       <aop:config>
           <aop:pointcut expression="execution(* com.cqupt.sh.service.*.*(..))" id="txPointcut"/>
           <aop:advisor advice-ref="txAdvice" pointcut-ref="txPointcut"/>
       </aop:config>

在运行测试类,就报错。

 NoClassDefFoundError错误一般是少加了什么jar包

 错误原因:缺少com.springsource.org.aopalliance-1.0.0.jar

解决方法,在lib路径下加入缺少对应的jar包问题解决

原文地址:https://www.cnblogs.com/Hdaydayup/p/6533285.html