Spring-data-jpa:2.0.3 兼容 Spring 版本 [英] Spring-data-jpa:2.0.3 Compatible Spring Version

查看:64
本文介绍了Spring-data-jpa:2.0.3 兼容 Spring 版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚将 spring-data-jpa 从版本 1.11.13 升级到 2.0.8.但是,现在我收到了 AbstractMethodError.我怀疑新版本的 spring-data-jpa 与我使用的当前 spring 版本不兼容,即 4.2.4.我什至尝试升级到 5.0.3 但它没有用.任何人都可以帮忙吗?

I have just upgraded spring-data-jpa from version 1.11.13 to 2.0.8. However, now I am getting AbstractMethodError. I am suspecting that the new version of spring-data-jpa is not compatible with current spring version I am using, that is 4.2.4. I even tried upgrading to 5.0.3 but it didn't work. Can anyone please help?

推荐答案

JB Nizet 已经向您指出了可以找到该信息的文档.虽然您选择的版本没有列为兼容版本,但它只是一个次要版本,所以我认为这不能解释 AbstractMethodError.确切的原因是至少需要完整的堆栈跟踪以及您正在使用的所有与 Spring 相关的依赖项.

JB Nizet already pointed you to the documentation where you find that information. While the version you picked isn't listed as compatible its only a Minor release behind so I don't think this explains the AbstractMethodError. What the exact reason for that is would require at least a full stack trace and all the Spring related dependencies you are using.

但我的印象是你正在做一些让你的生活变得不必要的事情.假设您使用的是 Maven 或类似的东西,只需指定 Spring Data JPA 的依赖项和版本.Maven 将拉取正确版本的 Spring 来配合它.

But I have the impression that you are doing something that makes your life unnecessary hard. Assuming you are using Maven or something similar, only specify the dependency and version of Spring Data JPA. Maven will pull the proper version of Spring to go with that.

如果您对 Spring 库有多个依赖项,则只指定那些除了您的代码之外什么都没有依赖的库.同样,Maven 会尽量拉下其他库(如 Spring Framework)的正确版本.

If you have multiple dependencies on Spring libraries only specify those where nothing but your code depends on. Again Maven will do it's best to pull down the correct version of other libraries like Spring Framework.

此时可能存在冲突,您可以使用 mvn dependency:tree -Dverbose.

At this point there might be conflicts which you can then analyse using mvn dependency:tree -Dverbose.

这篇关于Spring-data-jpa:2.0.3 兼容 Spring 版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆