在整合spring和mybatis的项目中报错
Configuration problem: Failed to import bean definitions from URL location [classpath:application-service.xml]
Unexpected exception parsing XML document from class path resource [application-service.xml]; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [application-service.xml]; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor
分析错误信息发现,是因为缺少aopalliance.jar包,aopalliance.jar —— AOP联盟的API包,里面包含了针对面向切面的接口。通常Spring等其它具备动态织入功能的框架依赖此包。当导入该jar包后,就不再报错了。