出现org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userContro

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘userController’ defined in file [D:\123\xnewtsfh\dubbo-web\target\dubbo-web-1.0-SNAPSHOT\WEB-INF\classes\com\xnewtech\core\controller\UserController.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanInitializationException: Failed to init remote service reference at filed userService in class com.xnewtech.core.controller.UserController; nested exception is java.lang.IllegalStateException: Failed to check the status of the service com.xnewtech.core.service.UserService. No provider available for the service com.xnewtech.core.service.UserService from the url zookeeper://192.168.200.128:2181/com.alibaba.dubbo.registry.RegistryService?application=dubbo-web&dubbo=2.8.4&interface=com.xnewtech.core.service.UserService&methods=showName&pid=5264&side=consumer&timestamp=1552440168260 to the consumer 192.168.142.1 use dubbo version 2.8.4

查看xml的配置:

		<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:dubbo-provider.xml</param-value>
org.springframework.web.context.ContextLoaderListener

注入失败的原因主要有:

1.没有添加注解。例如:@Service @Autowared @Controller

2.错误的注入方法

3.对于web.xml中监听器的xml配置错误。

所以我们要解决此问题,主要检查注解正确的添加,包引入是否正确,以及检查web.xml监听器的配置。

猜你喜欢

转载自blog.csdn.net/weixin_44516119/article/details/88529004