znanj 2017-11-29 01:36 采纳率: 66.7%
浏览 4506
已采纳

配置dubbo,启动消费端服务器出现这个问题

严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoPurchaseController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.saic.ndms.base.api.DemoPurchaseService com.saic.ndms.base.web.controller.DemoPurchaseController.demoPurchaseService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoPurchaseService': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: Failed to check the status of the service com.saic.ndms.base.api.DemoPurchaseService. No provider available for the service com.saic.ndms.base.api.DemoPurchaseService from the url zookeeper://127.0.0.1:2181/com.alibaba.dubbo.registry.RegistryService?application=ndms-base-server&dubbo=2.8.4-cep1.0&interface=com.saic.ndms.base.api.DemoPurchaseService&methods=countByExample,getAllDemoPurchase&pid=8972&revision=0.0.1-SNAPSHOT&side=consumer&timestamp=1511919329139 to the consumer 10.31.195.65 use dubbo version 2.8.4-cep1.0
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1202)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:762)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5077)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5591)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1574)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1564)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.saic.ndms.base.api.DemoPurchaseService com.saic.ndms.base.web.controller.DemoPurchaseController.demoPurchaseService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoPurchaseService': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: Failed to check the status of the service com.saic.ndms.base.api.DemoPurchaseService. No provider available for the service com.saic.ndms.base.api.DemoPurchaseService from the url zookeeper://127.0.0.1:2181/com.alibaba.dubbo.registry.RegistryService?application=ndms-base-server&dubbo=2.8.4-cep1.0&interface=com.saic.ndms.base.api.DemoPurchaseService&methods=countByExample,getAllDemoPurchase&pid=8972&revision=0.0.1-SNAPSHOT&side=consumer&timestamp=1511919329139 to the consumer 10.31.195.65 use dubbo version 2.8.4-cep1.0
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
... 22 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoPurchaseService': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: Failed to check the status of the service com.saic.ndms.base.api.DemoPurchaseService. No provider available for the service com.saic.ndms.base.api.DemoPurchaseService from the url zookeeper://127.0.0.1:2181/com.alibaba.dubbo.registry.RegistryService?application=ndms-base-server&dubbo=2.8.4-cep1.0&interface=com.saic.ndms.base.api.DemoPurchaseService&methods=countByExample,getAllDemoPurchase&pid=8972&revision=0.0.1-SNAPSHOT&side=consumer&timestamp=1511919329139 to the consumer 10.31.195.65 use dubbo version 2.8.4-cep1.0
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:175)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:103)
at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1517)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1127)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1051)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:949)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533)
... 24 more
Caused by: java.lang.IllegalStateException: Failed to check the status of the service com.saic.ndms.base.api.DemoPurchaseService. No provider available for the service com.saic.ndms.base.api.DemoPurchaseService from the url zookeeper://127.0.0.1:2181/com.alibaba.dubbo.registry.RegistryService?application=ndms-base-server&dubbo=2.8.4-cep1.0&interface=com.saic.ndms.base.api.DemoPurchaseService&methods=countByExample,getAllDemoPurchase&pid=8972&revision=0.0.1-SNAPSHOT&side=consumer&timestamp=1511919329139 to the consumer 10.31.195.65 use dubbo version 2.8.4-cep1.0
at com.alibaba.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:420)
at com.alibaba.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:300)
at com.alibaba.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:138)
at com.alibaba.dubbo.config.spring.ReferenceBean.getObject(ReferenceBean.java:65)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168)
... 32 more

  • 写回答

2条回答 默认 最新

  • wb_snail 2017-11-29 02:25
    关注

    服务端没有找到可以用的 demoPurchaseService dubbo对象 你看看服务端是不是没配置好

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用