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