解决Caused by: org.springframework.beans.factory.BeanCreationException:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDetailService' defined in class path resource [spring/spring-security.xml]: Cannot resolve reference to bean 'sellerService' while setting bean property 'sellerService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sellerService': FactoryBean threw exception on object creation; nested exception is org.I0Itec.zkclient.exception.ZkTimeoutException: Unable to connect to zookeeper server within timeout: 5000

或者

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authentication.dao.DaoAuthenticationProvider#0': Cannot resolve reference to bean 'userDetailService' while setting bean property 'userDetailsService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDetailService' defined in class path resource [spring/spring-security.xml]: Cannot resolve reference to bean 'sellerService' while setting bean property 'sellerService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sellerService': FactoryBean threw exception on object creation; nested exception is org.I0Itec.zkclient.exception.ZkTimeoutException: Unable to connect to zookeeper server within timeout: 5000

以上报错都是是连接zookeeper超时,解决步骤:

①:查看当前maven项目的配置文件的IP地址,与虚拟机中linux系统的IP地址是否相同,不相同则改为相同
②:查看linux的zookeeper是否启动,没有启动则将它启动,启动命令是
./zkServer.sh start(先进入zookeeper的安装目录下的bin目录)

③:主机必须可以连接上linux虚拟机,打开黑窗口,输入ping+空格+虚拟机IP地址
如果可以连接,则OK

确认修改后install项目,然后重写用tomcat运行一遍即可

你可能感兴趣的:(报错总结)