【問題解決】 web項目啓動不了 org.springframework.beans.factory.BeanCreationException: Could not autowire field:

錯誤:

Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.cb.udbservice.serviceice.UdbServiceIcePrx com.cb.register.cache.SysdataCache.udbServiceIcePrx; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘udbServiceIcePrx’ defined in ServletContext resource [/WEB-INF/conf/ice.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.cb.udbservice.serviceice.UdbServiceIcePrx com.cb.udbservice.serviceiceimpl.UdbIceServiceFactory.createUdbService()] threw exception; nested exception is Ice.NoEndpointException
proxy = “Udb/UdbService -t”
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessorAutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:506)atorg.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)atorg.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284)59moreCausedby:org.springframework.beans.factory.BeanCreationException:ErrorcreatingbeanwithnameudbServiceIcePrxdefinedinServletContextresource[/WEBINF/conf/ice.xml]:Instantiationofbeanfailed;nestedexceptionisorg.springframework.beans.factory.BeanDefinitionStoreException:Factorymethod[publiccom.cb.udbservice.serviceice.UdbServiceIcePrxcom.cb.udbservice.serviceiceimpl.UdbIceServiceFactory.createUdbService()]threwexception;nestedexceptionisIce.NoEndpointExceptionproxy=Udb/UdbServicetatorg.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:581)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1015)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)atorg.springframework.beans.factory.support.AbstractBeanFactory 1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:848)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:790)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:707)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:478)
… 61 more
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.cb.udbservice.serviceice.UdbServiceIcePrx com.cb.udbservice.serviceiceimpl.UdbIceServiceFactory.createUdbService()] threw exception; nested exception is Ice.NoEndpointException
proxy = “Udb/UdbService -t”
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:169)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:570)

解決方法:

修改ice host 配置
確定服務器地址是否正確且能正常運行,如下圖

這裏寫圖片描述

修改項目配置 和udb服務配置

發佈了65 篇原創文章 · 獲贊 71 · 訪問量 12萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章