以前我使用的是spring-cloud-starter-dataflow-server-local 1.2.3.RELEASE,它运行得很好。当我升级到1.3.0.RELEASE时,构建失败并出现编译错误:
org.springframework.beans.factory.BeanCreationException: Error creati
ng bean with name 'entityManagerFactory' defined in class path resource [org/spr
ingframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: In
vocation of init method failed; nested exception is org.hibernate.AnnotationExce
ption: AttributeConverter and explicit Type cannot be applied to same attribute
[org.springframework.cloud.dataflow.registry.domain.AppRegistration.metadataUri];remove @Type or specify @Convert(disableConversion = true)
我的pom.xml中的相关MAVEN配置:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.10.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spring-cloud.version>Dalston.SR4</spring-cloud.version>
<spring-cloud-dataflow-dependencies.version>1.3.0.RELEASE</spring-cloud-dataflow-dependencies.version>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-dataflow-server-local</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
那么有什么建议吗?提前谢谢。
答案 0 :(得分:1)
通过添加dependencis解决:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.2.12.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.2.12.Final</version>
</dependency>