Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'observableMVCConfiguration' defined in class path resource
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'singleReturnValueHandler' defined in class path resource
Caused by: java.lang.NoClassDefFoundError: rx/Single
以zookeeper为注册中心搭建spring cloud环境 ,出现这个错,一般是zk依赖与boot 版本兼容问题。最后,把pom的依赖改动一下,启动就不再报错了。错误如下
这是原来的pom 配置
最后,把pom配置改为一下,启动就没什么问题了。
代码如下:
1.<dependencies> <!-- spring-cloud --> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-config</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-zookeeper-discovery</artifactId> </dependency> </dependencies>
2.<dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>Camden.SR2</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement>