docker 部署spring cloud config 由于特殊字符导致获取不到整个配置文件

1、开发测试环境都没问题

2、生成进行docker 部署时

2019-12-10 13:45:29.732 [main] INFO  o.s.b.f.a.AutowiredAnnotationBeanPostProcessor -JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2019-12-10 13:45:29.858 [main] INFO  o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker -Bean 'org.springframework.retry.annotation.RetryConfiguration' of type [org.springframework.retry.annotation.RetryConfiguration$$EnhancerBySpringCGLIB$$83b5cbfe] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-12-10 13:45:29.882 [main] INFO  o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker -Bean 'configurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$aa0c36d6] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-12-10 13:45:30.162 [main] INFO  o.s.c.n.eureka.InstanceInfoFactory -Setting initial instance status as: STARTING
2019-12-10 13:45:30.273 [main] INFO  c.netflix.discovery.DiscoveryClient -Initializing Eureka in region us-east-1
2019-12-10 13:45:30.566 [main] INFO  c.n.d.p.DiscoveryJerseyProvider -Using JSON encoding codec LegacyJacksonJson
2019-12-10 13:45:30.567 [main] INFO  c.n.d.p.DiscoveryJerseyProvider -Using JSON decoding codec LegacyJacksonJson
2019-12-10 13:45:30.786 [main] INFO  c.n.d.p.DiscoveryJerseyProvider -Using XML encoding codec XStreamXml
2019-12-10 13:45:30.786 [main] INFO  c.n.d.p.DiscoveryJerseyProvider -Using XML decoding codec XStreamXml
2019-12-10 13:45:31.269 [main] INFO  c.n.d.s.r.aws.ConfigClusterResolver -Resolving eureka endpoints via configuration
2019-12-10 13:45:31.302 [main] INFO  c.netflix.discovery.DiscoveryClient -Disable delta property : false
2019-12-10 13:45:31.303 [main] INFO  c.netflix.discovery.DiscoveryClient -Single vip registry refresh property : null
2019-12-10 13:45:31.303 [main] INFO  c.netflix.discovery.DiscoveryClient -Force full registry fetch : false
2019-12-10 13:45:31.303 [main] INFO  c.netflix.discovery.DiscoveryClient -Application is null : false
2019-12-10 13:45:31.303 [main] INFO  c.netflix.discovery.DiscoveryClient -Registered Applications size is zero : true
2019-12-10 13:45:31.303 [main] INFO  c.netflix.discovery.DiscoveryClient -Application version is -1: true
2019-12-10 13:45:31.303 [main] INFO  c.netflix.discovery.DiscoveryClient -Getting all instance registry info from the eureka server
2019-12-10 13:45:31.647 [main] INFO  c.netflix.discovery.DiscoveryClient -The response status is 200
2019-12-10 13:45:31.652 [main] INFO  c.netflix.discovery.DiscoveryClient -Not registering with Eureka server per configuration
2019-12-10 13:45:31.659 [main] INFO  c.netflix.discovery.DiscoveryClient -Discovery Client initialized at timestamp 1575956731657 with initial instances count: 17
2019-12-10 13:45:32.007 [main] INFO  o.s.c.c.c.ConfigServicePropertySourceLocator -Fetching config from server at : http://192.168.0.5:13000/
2019-12-10 13:45:33.301 [main] INFO  o.s.c.c.c.ConfigServicePropertySourceLocator -Fetching config from server at : http://192.168.0.5:13000/
2019-12-10 13:45:34.604 [main] INFO  o.s.c.c.c.ConfigServicePropertySourceLocator -Fetching config from server at : http://192.168.0.5:13000/
2019-12-10 13:45:36.023 [main] INFO  o.s.c.c.c.ConfigServicePropertySourceLocator -Fetching config from server at : http://192.168.0.5:13000/
2019-12-10 13:45:37.561 [main] INFO  o.s.c.c.c.ConfigServicePropertySourceLocator -Fetching config from server at : http://192.168.0.5:13000/
2019-12-10 13:45:39.229 [main] INFO  o.s.c.c.c.ConfigServicePropertySourceLocator -Fetching config from server at : http://192.168.0.5:13000/
2019-12-10 13:45:39.442 [main] ERROR o.s.boot.SpringApplication -Application run failed
java.lang.IllegalStateException: Could not locate PropertySource and the fail fast property is set, failing
    at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:136)
    at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator$$FastClassBySpringCGLIB$$fa44b2a.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
    at org.springframework.retry.interceptor.RetryOperationsInterceptor$1.doWithRetry(RetryOperationsInterceptor.java:91)
    at org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:287)
    at org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:164)
    at org.springframework.retry.interceptor.RetryOperationsInterceptor.invoke(RetryOperationsInterceptor.java:118)
    at org.springframework.retry.annotation.AnnotationAwareRetryOperationsInterceptor.invoke(AnnotationAwareRetryOperationsInterceptor.java:153)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
    at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator$$EnhancerBySpringCGLIB$$d67c8f1.locate(<generated>)
    at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:94)
    at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:636)
    at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:376)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:328)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1258)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1246)
    at com.eatbeancar.UserApplication.main(UserApplication.java:19)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: org.springframework.web.client.HttpServerErrorException: 500 null
    at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:97)
    at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:79)
    at org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63)
    at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:766)
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:724)
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:680)
    at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:600)
    at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.getRemoteEnvironment(ConfigServicePropertySourceLocator.java:218)
    at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:96)
    ... 27 common frames omitted
 

到容器内查看 配置文件是加载进去的

docker 部署spring cloud config 由于特殊字符导致获取不到整个配置文件

然后获取 dev都ok 对比发现就是因为一个特殊字符问题!

docker 部署spring cloud config 由于特殊字符导致获取不到整个配置文件

用单引号引起了就好了。。

小问题还是发一下,万一有人一样的问题呢。。。