我尝试编写一个spring cloud配置服务器example.My maven的pom配置。
<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中
<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文件之外
请帮帮我,谢谢!
发布于 2018-05-23 11:18:16
你的pom有这样的spring.verion属性吗:
<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
https://stackoverflow.com/questions/47848021
复制相似问题