将 spring-cloud-starter-dataflow-server-local 升级到 1.3.0 时生成错误

Posted

技术标签:

【中文标题】将 spring-cloud-starter-dataflow-server-local 升级到 1.3.0 时生成错误【英文标题】:Build error when upgrade spring-cloud-starter-dataflow-server-local to 1.3.0 【发布时间】:2018-08-01 14:20:49 【问题描述】:

以前我使用的是 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>

所以有什么建议吗?提前致谢。

【问题讨论】:

【参考方案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>

【讨论】:

以上是关于将 spring-cloud-starter-dataflow-server-local 升级到 1.3.0 时生成错误的主要内容,如果未能解决你的问题,请参考以下文章

如何将Ios文件上传到

Javascript 将正则表达式 \\n 替换为 \n,将 \\t 替换为 \t,将 \\r 替换为 \r 等等

如何将视频文件转换格式

sh 一个将生成CA的脚本,将CA导入到钥匙串中,然后它将创建一个证书并与CA签名,然后将其导入到

python怎么将0写入文件?

如何将CMD窗口背景改成透明?