首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >spring-cloud- config : spring-cloud-config maven配置错误

spring-cloud- config : spring-cloud-config maven配置错误
EN

Stack Overflow用户
提问于 2017-12-17 01:00:51
回答 1查看 611关注 0票数 2

我尝试编写一个spring cloud配置服务器example.My maven的pom配置。

代码语言:javascript
复制
<parent>
    <groupId>cn.bcolor</groupId>
    <artifactId>bcolor-parent-pom</artifactId>
    <version>1.0-SNAPSHOT</version>
</parent>

<groupId>cn.bcolor</groupId>
<artifactId>bcolor-config-center</artifactId>
<version>1.0.0</version>


<dependencies>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-config-server</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-eureka</artifactId>
    </dependency>

</dependencies>

bcolor-parent-pom

代码语言:javascript
复制
     <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-dependencies</artifactId>
            <version>1.5.9.RELEASE</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>Edgware.RELEASE</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>

当我运行程序时,异常如下所示

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.actuate.autoconfigure.EndpointAutoConfiguration': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.autoconfigure.EndpointAutoConfiguration$$EnhancerBySpringCGLIB$$29caa1fa]: Constructor threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'configServerHealthIndicator' defined in class path resource [org/springframework/cloud/config/server/config/EnvironmentRepositoryConfiguration.class]: Unsatisfied dependency expressed through method 'configServerHealthIndicator' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.cloud.config.server.config.CompositeConfiguration': Unsatisfied dependency expressed through method 'setEnvironmentRepos' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.cloud.config.server.config.DefaultRepositoryConfiguration': Unsatisfied dependency expressed through field 'transportConfigCallback'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'propertiesBasedSshTransportCallback' defined in class path resource [org/springframework/cloud/config/server/config/TransportConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.eclipse.jgit.api.TransportConfigCallback]: Factory method 'propertiesBasedSshTransportCallback' threw exception; nested exception is java.lang.AbstractMethodError: org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.forExecutables()Ljavax/validation/executable/ExecutableValidator;

我根据官网的例子进行配置。除了此pom文件之外

请帮帮我,谢谢!

EN

回答 1

Stack Overflow用户

发布于 2018-05-23 11:18:16

你的pom有这样的spring.verion属性吗:

代码语言:javascript
复制
<properties>
  <spring.version>4.3.8.RELEASE</spring.version>
</properties>

如果在运行'mvn spring-boot:run‘命令时同时使用spring.verion属性、spring-boot-maven-plugin和Spring Config,你会得到一个错误。

父级错误无法在没有-

的项目上执行目标父级(默认-cli):运行时发生异常。org/springframework/cloud/config/server/config/TransportConfiguration.class::帮助:通过工厂方法实例化bean失败;嵌套异常是org.springframework.beans.BeanInstantiationException:无法实例化帮助:工厂方法‘org.eclipse.jgit.api.TransportConfigCallback’引发异常;嵌套异常是java.lang.AbstractMethodError: org.springframework.beans.BeanInstantiationException:-> Help 1

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47848021

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档