最近工作在使用Spring Cloud微服务时遇到一个问题,在本地的idea中启动服务时有如下错误无法获取到config服务中的配置数据,导致微服务无法启动。
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'applyCodeServiceImpl':
Unsatisfied dependency expressed through field 'applyCodeConfig';
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'applyCodeConfig': In jection of autowired dependencies failed;
nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'fastdfs.uploadPath' in value "${fastdfs.uploadPath}"
在网上找了下资料没有找到类似的解决方案,但是从部分网上获得灵感。
微服务的客户端不能有服务端的jar包。
于是在idea中搜索依赖jar包,发现客户端中既有config-client包又有config-server包。。