今天再做一个maven项目的新功能,完成后启动maven想看效果,结果连首页都访问不了出现500,原先没添加功能的时候可以,
我的报错信息如下:
严重: StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘itemCatController’: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private cn.e3mall.service.ItemCatService cn.e3mall.controller.ItemCatController.itemCatService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘itemCatService’: FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: Failed to check the status of the service cn.e3mall.service.ItemCatService. No provider available for the service cn.e3mall.service.ItemCatService from the url zookeeper://192.168.80.130:2181/com.alibaba.dubbo.registry.RegistryService?application=e3-manager-web&dubbo=2.5.3&interface=cn.e3mall.service.ItemCatService&methods=getItemCatTree&pid=16952&revision=0.0.1-SNAPSHOT&side=consumer×tamp=1551446827467 to the consumer 192.168.80.1 use dubbo version 2.5.3
既然是连首页80端口都访问不了,那么问题极大可能出现在前端控制器上,和spring配置文件,有几个原因:
1)是否有加入 @Controller…以便spring扫描
2) 在dubbo中服务端是否将表现端的工程进行共享,
3)如果都有,那么是否服务端提供给表现端所需要的类的包错误!我是因为服务端提供了实现类的包,而在表现端没有添加该依赖,只添加了接口,所以在提供服务的时候确定你给表现端的服务包是否正确!
4)检查spring配置文件中的 自动扫描(自动注入) <context:component-scan base-package=“serviceImpl” />的base-package对应的报名是否一致。
5)web文件中是否配置正确