啟動異常tried to access method org.springframework.core.GenericTypeResolver.getTypeVariableMap


在使用spring-data-jpa的發生異常

Caused by: java.lang.IllegalAccessError: tried to access method org.springframework.core.GenericTypeResolver.getTypeVariableMap(Ljava/lang/Class;)Ljava/util/Map; from class org.springframework.data.util.ClassTypeInformation
at org.springframework.data.util.ClassTypeInformation.<init>(ClassTypeInformation.java:96)
at org.springframework.data.util.ClassTypeInformation.<clinit>(ClassTypeInformation.java:42)
at org.springframework.data.repository.core.support.AbstractRepositoryMetadata.<init>(AbstractRepositoryMetadata.java:43)
at org.springframework.data.repository.core.support.DefaultRepositoryMetadata.<init>(DefaultRepositoryMetadata.java:41)
at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepositoryMetadata(RepositoryFactorySupport.java:154)
at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:125)
at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:114)
at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:38)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
... 34 more

原因是spring-data-jpa.jar的版本和spring-data-commons-core.jar的版本不匹配所造成的,spring-data-commons-core.jar的版本過高了.

在發生異常的時候我的版本是:spring-data-jpa-1.0.2.RELEASE.jar和spring-data-commons-core-1.3.0.M1.jar

更改后:spring-data-jpa-1.0.2.RELEASE.jar和spring-data-commons-core-1.1.0.RELEASE.jar (OK)

由於這個錯誤我還遇到:

java.lang.AbstractMethodError: org.springframework.data.jpa.repository.config.SimpleJpaRepositoryConfiguration.getRepositoryBaseInterface()Ljava/lang/Class;

  




免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM