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条)

报告相同问题?

悬赏问题

  • ¥120 目前wxid加好友的渠道都被和谐了吗
  • ¥15 关于#网络#的问题:网络是从楼上引一根网线下来,接了2台傻瓜交换机,也更换了ip还是不行
  • ¥15 资源泄露软件闪退怎么解决?
  • ¥15 CCF-CSP 2023 第三题 解压缩(50%)
  • ¥30 comfyui openpose报错
  • ¥20 Wpf Datarid单元格闪烁效果的实现
  • ¥15 图像分割、图像边缘提取
  • ¥15 sqlserver执行存储过程报错
  • ¥100 nuxt、uniapp、ruoyi-vue 相关发布问题
  • ¥15 浮窗和全屏应用同时存在,全屏应用输入法无法弹出