2016-07-26 5 views
3

かなり簡単なSpring Boot 1.3アプリケーションがあり、1.4 RC1にアップグレードしようとしています。箱の構成から外れているものはほとんどありません。私がしようとすると、アプリケーションまたは実行するテストを開始すると、私は次を得る:AbstractMethodErrorはorg.hibernate.internal.SessionFactoryImplによってスローされます。 <init> Spring Boot 1.3から1.4 RC1にアップグレードするとき

12:06:27.237 [QUIET] [system.out] 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 
12:06:27.237 [QUIET] [system.out] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578) ~[spring-beans-4.3.1.RELEASE.jar:4.3.1.RELEASE] 
12:06:27.237 [QUIET] [system.out] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) ~[spring-beans-4.3.1.RELEASE.jar:4.3.1.RELEASE] 
12:06:27.237 [QUIET] [system.out] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.3.1.RELEASE.jar:4.3.1.RELEASE] 
12:06:27.237 [QUIET] [system.out] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.1.RELEASE.jar:4.3.1.RELEASE] 
12:06:27.237 [QUIET] [system.out] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.1.RELEASE.jar:4.3.1.RELEASE] 
12:06:27.238 [QUIET] [system.out] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.1.RELEASE.jar:4.3.1.RELEASE] 
12:06:27.238 [QUIET] [system.out] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.1.RELEASE.jar:4.3.1.RELEASE] 
12:06:27.238 [QUIET] [system.out] at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1076) ~[spring-context-4.3.1.RELEASE.jar:4.3.1.RELEASE] 
12:06:27.238 [QUIET] [system.out] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:851) ~[spring-context-4.3.1.RELEASE.jar:4.3.1.RELEASE] 
12:06:27.238 [QUIET] [system.out] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541) ~[spring-context-4.3.1.RELEASE.jar:4.3.1.RELEASE] 
12:06:27.238 [QUIET] [system.out] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.4.0.RC1.jar:1.4.0.RC1] 
12:06:27.238 [QUIET] [system.out] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) [spring-boot-1.4.0.RC1.jar:1.4.0.RC1] 
12:06:27.238 [QUIET] [system.out] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:369) [spring-boot-1.4.0.RC1.jar:1.4.0.RC1] 
12:06:27.238 [QUIET] [system.out] at org.springframework.boot.SpringApplication.run(SpringApplication.java:313) [spring-boot-1.4.0.RC1.jar:1.4.0.RC1] 
12:06:27.238 [QUIET] [system.out] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1185) [spring-boot-1.4.0.RC1.jar:1.4.0.RC1] 
12:06:27.238 [QUIET] [system.out] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1174) [spring-boot-1.4.0.RC1.jar:1.4.0.RC1] 
12:06:27.239 [QUIET] [system.out] at com.hightouchinc.notifications.NotificationsApplication.main(NotificationsApplication.java:17) [main/:na] 
12:06:27.239 [QUIET] [system.out] Caused by: java.lang.AbstractMethodError: null 
12:06:27.239 [QUIET] [system.out] at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:278) ~[hibernate-core-5.0.9.Final.jar:5.0.9.Final] 
12:06:27.239 [QUIET] [system.out] at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444) ~[hibernate-core-5.0.9.Final.jar:5.0.9.Final] 
12:06:27.239 [QUIET] [system.out] at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:879) ~[hibernate-entitymanager-5.0.9.Final.jar:5.0.9.Final] 
12:06:27.239 [QUIET] [system.out] at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:60) ~[spring-orm-4.3.1.RELEASE.jar:4.3.1.RELEASE] 
12:06:27.239 [QUIET] [system.out] at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:338) ~[spring-orm-4.3.1.RELEASE.jar:4.3.1.RELEASE] 
12:06:27.239 [QUIET] [system.out] at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:373) ~[spring-orm-4.3.1.RELEASE.jar:4.3.1.RELEASE] 
12:06:27.239 [QUIET] [system.out] at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:362) ~[spring-orm-4.3.1.RELEASE.jar:4.3.1.RELEASE] 
12:06:27.239 [QUIET] [system.out] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637) ~[spring-beans-4.3.1.RELEASE.jar:4.3.1.RELEASE] 
12:06:27.239 [QUIET] [system.out] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574) ~[spring-beans-4.3.1.RELEASE.jar:4.3.1.RELEASE] 
12:06:27.240 [QUIET] [system.out] ... 16 common frames omitted 

は私のエントリポイントクラスは、次のようになります。

spring: 
    datasource: 
    url: jdbc:postgresql://localhost:5432/notifications 
    username: ---- 
    password: ---- 
    driverClassName: org.postgresql.Driver 
    jpa: 
    properties: 
     hibernate: 
     format_sql: true 
    database-platform: org.hibernate.dialect.PostgreSQLDialect 
    hibernate: 
     ddl-auto: create-drop 
    generate-ddl: true 

@SpringBootApplication 
public class NotificationsApplication { 

    public static void main(String[] args) { 
     SpringApplication.run(NotificationsApplication.class, args); 
    } 
} 

は私のデータベースの設定は次のようになります

私は1.4マイルストーンとRC1のすべての変更履歴を読みました。私が何かを提案したものが見つからないため、起動しないように変更されました。 build.gradleから

依存性:

dependencies { 
    compile('org.springframework.boot:spring-boot-starter-data-jpa') 
    compile('org.springframework.boot:spring-boot-starter-actuator') 
    compile('org.springframework.boot:spring-boot-starter-web') 
    compile('org.springframework:spring-tx') 
    compile('javax.el:javax.el-api:3.0.0') 
    compile('com.google.guava:guava:19.0') 
    compile('com.fasterxml.jackson.datatype:jackson-datatype-hibernate5:2.8.1') 
    compile("com.fasterxml.jackson.datatype:jackson-datatype-joda:2.7.5") 
    compile('joda-time:joda-time:2.9.4') 
    compile('org.jadira.usertype:usertype.core:4.0.0.GA') 
    compile('com.h2database:h2') 
    runtime('org.postgresql:postgresql:9.4.1208') 
    testCompile('junit:junit') 
    testCompile('org.springframework.boot:spring-boot-starter-test') 
    testCompile('com.jayway.jsonpath:json-path') 
} 
+0

あなたが何かを持っていますかそれ以外の場合は、クラスパス上でHibernateに関連していますか?失敗した行は、org.hibernate.integrator.spi.Integrator'に対して 'integrate'を呼び出そうとしています.Integratorの署名は5.0で変更されています。 –

+0

私はbuild.gradleの依存関係で質問を更新しました。 – Gregg

+0

私は春のブートとグアバに問題がありました。依存関係のツリーを見て、クラスパスに複数のグアバがあるかどうかを確認してください。 –

答えて

4

私は問題はこの依存性であることを考える:

compile('org.jadira.usertype:usertype.core:4.0.0.GA') 

それはorg.hibernate.integrator.spi.Integratorを実装する3つのクラスが含まれます。

  • UserTypeJodaTimeHibernateIntegrator
  • UserTypeJodaMoneyHibernateIntegrator
  • UserTypeLegacyJdkMoneyHibernateIntegrator

Jadira contains a changeの5.0.0.GAリリース "Hibernateは5アンダー固定Integratorの行動" ということは、アップグレードのように見えるので、問題を解決します:

compile('org.jadira.usertype:usertype.core:5.0.0.GA') 
+0

それでした!良いキャッチ。本当にありがとう。 – Gregg

+0

興味深いのは、新しいバージョン6.0.1.GAが(少なくとも私の設定では)Integratorの動作を再び破壊するということです。だから私は5.0.0.GAに固執しなければならなかった – naXa

関連する問題