Att*_*nen 1 java spring hibernate jpa maven
尝试启动 SpringApplication 时,使用 Maven 添加 Jadira 依赖项会导致 AbstractMethodError。堆栈跟踪中没有任何帮助;它没有引用我自己的任何类。是什么导致了这个错误,我该如何解决?
这是依赖项:
<dependency>
<groupId>org.jadira.usertype</groupId>
<artifactId>usertype.core</artifactId>
<version>3.1.0.CR1</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
这是堆栈跟踪的一部分:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is java.lang.AbstractMethodError
...
at sec.project.CyberSecurityBaseProjectApplication.main(CyberSecurityBaseProjectApplication.java:17) [classes/:na] // this is simply the line that launches the Spring app
...
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-1.4.2.RELEASE.jar:1.4.2.RELEASE]
Caused by: java.lang.AbstractMethodError: null
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:280) ~[hibernate-core-5.0.11.Final.jar:5.0.11.Final]
...
Run Code Online (Sandbox Code Playgroud)
FWIW,我试图做这个。
你所指的文章说
该代码适用于 Spring Boot 1.2.2 和 Hibernate 4.5
从您的日志看来,您使用的是 Spring Boot 1.4.2,它将获取 Hibernate 5 jar。Hibernate 5 和旧版本jadira
(您使用的是 3.1.0.CR1)存在一些问题。自 5.0.0.GA 版本的 jadira 用户类型以来,此问题已得到修复。您能否尝试使用https://mvnrepository.com/artifact/org.jadira.usertype/usertype.core 上提供的新版本
归档时间: |
|
查看次数: |
521 次 |
最近记录: |