Use Springdata to appear java.lang.AbstractMethodError

Source: Internet
Author: User

Recently learned about Springdata, when adding springdata support, there are problems such as:

The jars required by Springdata are: Spring-data-jpa.jar spring-data-commons.jar Slf4j-api.jar

There will also be an exception if you do not add slf4j, but the exception is very clear, that is, less slf4j, may springdata use SLF4 as the log frame

Back to java.lang.AbstractMethodError This error, first explain why: it is version incompatibility caused.

Originally I was using the 2.0 version of SPRING-DATA-JPA, is currently the latest, spring-data-commons version of the record, there was this error, view the official documentation, found that 2.0 version is to support the Spring Framework 5 However, I am using the spring version is 4.3.6 so it is incompatible.

Attached to the official words:

So I'll just switch to Spring-data-jpa-1.11.8.jar. So how do I know which version of Spring-data-commons to use?

Yes, I used MAVEN to build the project, and sure enough these version issues, jar package conflicts all need maven to handle

Finally, let me say the specific version of the Springdata I use:

Spring-data-jpa-1.11.8.release.jar Spring-data-commons-1.13.8.release.jar Of course don't forget slf4j slf4j-api-1.7.5.jar

Use Springdata to appear java.lang.AbstractMethodError

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.