Spring Boot v1.2由于RepositoryInformation引起的AbstractMethodError

rak*_*pan 3 spring-test spring-data-jpa spring-boot

我正在构建一个基于Spring Boot v1.2的应用程序.虽然我的应用程序成功启动并执行良好(到目前为止......),但由于AbstractMethodError,我无法使用spring启动框架进行测试.

跟踪的最后几行如下

Caused by: java.lang.AbstractMethodError: org.springframework.data.jpa.repository.support.LockModeRepositoryPostProcessor.postProcess(Lorg/springframework/aop/framework/ProxyFactory;Lorg/springframework/data/repository/core/RepositoryInformation;)V
    at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:185)
    at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.initAndReturn(RepositoryFactoryBeanSupport.java:239)
    at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:225)
    at org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean.afterPropertiesSet(JpaRepositoryFactoryBean.java:84)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1627)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1564)
    ... 55 more
Run Code Online (Sandbox Code Playgroud)

为了分析上面的错误,我检查了包含上述类的classpath中的jar文件.所以信息如下

jar:file:/C:/rearch/intellij-workspace/springbootproj/lib/spring-aop-4.1.2.RELEASE.jar!/org/springframework/aop/framework/ProxyFactory.class
jar:file:/C:/rearch/mavenrepo/org/springframework/data/spring-data-commons/1.9.1.RELEASE/spring-data-commons-1.9.1.RELEASE.jar!/org/springframework/data/repository/core/RepositoryInformation.class
jar:file:/C:/rearch/intellij-workspace/springbootproj/lib/spring-data-jpa-1.3.3.jar!/org/springframework/data/jpa/repository/support/LockModeRepositoryPostProcessor.class
jar:file:/C:/rearch/intellij-workspace/springbootproj/lib/spring-test-4.1.2.RELEASE.jar!/org/springframework/test/context/support/DependencyInjectionTestExecutionListener.class
Run Code Online (Sandbox Code Playgroud)

我不确定为什么spring-data-commons来自maven repostory文件夹,而其他的是从项目库提供的.

在我调试时,我同时需要你的帮助来确定上述库之间的版本兼容性.我无法准确指出导致错误的确切原因.请帮忙!

谢谢

rak*_*pan 6

问题在于,与Spring引导应用程序冲突的库的intellij配置.我手动从Maven存储库中替换了所需的库,这对我来说很有用.


根据Elron的要求..

在资源管理器中打开项目文件夹,验证项目中的第三方库版本是否与您实际期望的版本匹配.如果某些内容不匹配,只需将文件替换为您期望的文件即可.在我的情况下,因为我使用Maven,我没有看到需要在项目下的新lib文件夹中明确地保存这些库.所以,我刚刚删除了lib文件夹中的所有文件,事情又开始了.