slyak / spring-data-jpa-extra

spring data jpa with template dynamic query (eg: freemarker,velocity etc.) like mybatis. The master branch already support springboot2+ spring5+
Apache License 2.0
400 stars 116 forks source link

使用 spring-boot 1.5.20 时,出异常,项目无法启动 #47

Open guicw opened 5 years ago

guicw commented 5 years ago

APPLICATION FAILED TO START


Description:

An attempt was made to call the method org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy.create(Ljavax/persistence/EntityManager;Lorg/springframework/data/repository/query/QueryLookupStrategy$Key;Lorg/springframework/data/jpa/provider/QueryExtractor;Lorg/springframework/data/repository/query/EvaluationContextProvider;)Lorg/springframework/data/repository/query/QueryLookupStrategy; but it does not exist. Its class, org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy, is available from the following locations:

jar:file:/D:/maven_repo/org/springframework/data/spring-data-jpa/1.11.20.RELEASE/spring-data-jpa-1.11.20.RELEASE.jar!/org/springframework/data/jpa/repository/query/JpaQueryLookupStrategy.class

It was loaded from the following location:

file:/D:/maven_repo/org/springframework/data/spring-data-jpa/1.11.20.RELEASE/spring-data-jpa-1.11.20.RELEASE.jar

Action:

Correct the classpath of your application so that it contains a single, compatible version of org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy

**项目中spring-boot用的1.5.20 spring-data-jpa-extra版本中2.1.1,2.1.2,2.1.21这些都试过。无法启动,上面是异常信息。 后面将项目中spring-boot降低了一个版本,才成功。 如下:

org.springframework.boot spring-boot-starter-parent 1.5.19.RELEASE

但这只是临时之举,能否修正呢?**

stormning commented 5 years ago

版本兼容性是个头疼的问题,后面看看能否修改到尽量少侵入spring源码,因为之前的版本,spring预留的扩展空间比较小