配置了GIT Repo的Spring云配置服务器未成功启动

brccelvz  于 2023-01-13  发布在  Spring
关注(0)|答案(1)|浏览(146)

我正在使用Sprint Boot v2.6.12和Spring Cloud Config Server v3.1.1构建Spring Cloud Config服务器。下面是application.yml配置,

spring:
  application:
    name: config-server  
  main:
    allow-bean-definition-overriding: true
  cloud:
    config:
      server:
        git:
          uri: git@github.aus.thenational.com:demo/case_configuration.git
          skip-ssl-validation: true
          default-label: master
          clone-on-start: true
          clone-submodules: true
          force-pull: true
          refresh-rate: 60
          search-paths:
          - case/folder1
          - case/folder2

服务器启动时出现的异常如下所示,

2022-12-21 09:51:10.827  WARN 11524 --- [main] [CID:] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'healthContributorRegistry' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]: Unsatisfied dependency expressed through method 'healthContributorRegistry' parameter 2; 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$ConfigServerActuatorConfiguration.class]: Unsatisfied dependency expressed through method 'configServerHealthIndicator' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'searchPathCompositeEnvironmentRepository' defined in class path resource [org/springframework/cloud/config/server/config/CompositeConfiguration.class]: Unsatisfied dependency expressed through method 'searchPathCompositeEnvironmentRepository' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'defaultEnvironmentRepository' defined in class path resource [org/springframework/cloud/config/server/config/DefaultRepositoryConfiguration.class]: Unsatisfied dependency expressed through method 'defaultEnvironmentRepository' parameter 1; nested exception is org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'multipleJGitEnvironmentProperties' is expected to be of type 'org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentProperties' but was actually of type 'com.sun.proxy.$Proxy140'

***************************

APPLICATION FAILED TO START
***************************

Description:

The bean 'multipleJGitEnvironmentProperties' could not be injected because it is a JDK dynamic proxy

The bean is of type 'com.sun.proxy.$Proxy140' and implements:
        org.springframework.cloud.config.server.support.HttpEnvironmentRepositoryProperties
        org.springframework.cloud.config.server.support.EnvironmentRepositoryProperties
        org.springframework.aop.SpringProxy
        org.springframework.aop.framework.Advised
        org.springframework.core.DecoratingProxy

Expected a bean of type 'org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentProperties' which implements:

Action:

Consider injecting the bean as one of its interfaces or forcing the use of CGLib-based proxies by setting proxyTargetClass=true on @EnableAsync and/or @EnableCaching.

我试着配置http和https代理设置沿着其他GIT配置,但没有效果。
预期配置服务器应成功启动。

s3fp2yjn

s3fp2yjn1#

试图通过在application.yml中配置与Spring AOP相关的配置来解决这个问题,但也没有起作用。
看起来像是和图书馆版本有关的东西。

相关问题