spring cloud config---Could not resolve placeholder 'foo' in string value "${foo}"
来源:互联网 发布:正版用友软件价格 编辑:程序博客网 时间:2024/05/16 23:49
在运行configclient项目时发生以下错误:
2017-08-10 22:41:52.006 WARN 59068 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'configClientApplication': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'foo' in string value "${foo}"
2017-08-10 22:41:52.012 INFO 59068 --- [ main] o.apache.catalina.core.StandardService : Stopping service Tomcat
经过仔细排查,配置文件和代码都没有问题,就是一直报错,后来发现configclient项目不能在maven module中正确运行,特别是跟config server在一个maven project中,原因是pom。xml的依赖造成的,作为config client不能有以下依赖:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
否则会报错,因此如果config client和config server在同一个项目中则要注意依赖问题,而新建一个maven project可以比较容易的避免上述问题。
- spring cloud config---Could not resolve placeholder 'foo' in string value "${foo}"
- 报错Could not resolve placeholder 'jdbc.driverClassName' in string value "${jdbc.driverClassName}
- $Value{}ntException: Could not resolve placeholder 'KEY' in string value "${
- Could not resolve placeholder 'spring.security.mapping.directory' in string value "${spring.security
- Could not resolve placeholder 'driverClassName' in string value "${driverClassName}"
- Could not resolve placeholder 'CUST_INDUSTORY' in string value "${CUST_INDUSTORY}"
- Could not resolve placeholder 'driver' in string value "${driver}"
- 解决 IllegalArgumentException: Could not resolve placeholder in string value "${XXXXXX}"
- Could not resolve placeholder 'driverClasss' in string value "${driverClasss}"
- 解决 IllegalArgumentException: Could not resolve placeholder in string value "${XXXXXX}"
- spring boot could not resolve placeholder in string value 问题解决方法
- sharding jdbc--Cloud not resolve placeholder … in string value …?
- Could not resolve placeholder 'jdbc.driverClassName' in string value "${jdbc.driverClassName}
- Could not resolve placeholder 'master.jdbc.url' in string value "${master.jdbc.url}"
- 解决 Could not resolve placeholder 'some.var.name' in string value
- Could not resolve placeholder 'jdbc.username' in string value "${jdbc.username}"
- Could not resolve placeholder 'jdbc.url' in string value "${jdbc.url}"
- Could not resolve placeholder 'redis.pool.maxTotal' in string value "${redis.pool.maxTotal}"
- #pragma命令详解(二)
- Find All Numbers Disappeared in an Array
- TQ2440 基于V4L2编程框架的 LCD实时显示(上)
- C++编程思想之运算符重载
- C++ 实现求一串数字的逆序数{线性代数里的逆序数}
- spring cloud config---Could not resolve placeholder 'foo' in string value "${foo}"
- 双端队列
- Windows编程--WinIO
- Python 命令行参数
- hdu题目分类
- HIVE入门二之表DDL(一)
- 套路和局
- 多进程修改全局变量
- Leetcode 212. Word Search II