当前位置: 代码迷 >> Java Web开发 >> No unique bean of type [.] is defined: Unsatisfied dependency of type,该怎么解决
  详细解决方案

No unique bean of type [.] is defined: Unsatisfied dependency of type,该怎么解决

热度:766   发布时间:2016-04-17 00:50:05.0
No unique bean of type [...] is defined: Unsatisfied dependency of type
11-10-13 16:49:09 (严) StandardContext.listenerStart : Exception sending context initialize
d event to listener instance of class org.springframework.web.context.ContextLoaderListene
r
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'av
Service': Autowiring of fields failed; nested exception is org.springframework.beans.facto
ry.BeanCreationException: Could not autowire field: private com.cares.fare.factory.FareCac
ulateFactory com.cares.av.AvServiceImpl.agentFareCaculateFactory; nested exception is org.
springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.c
ares.fare.factory.FareCaculateFactory] is defined: Unsatisfied dependency of type [interfa
ce com.cares.fare.factory.FareCaculateFactory]: expected at least 1 matching bean
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.post
ProcessAfterInstantiation(AutowiredAnnotationBeanPostProcessor.java:243)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateB
ean(AbstractAutowireCapableBeanFactory.java:959)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateB
ean(AbstractAutowireCapableBeanFactory.java:472)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(Abs
tractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBea
n(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBean
Factory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(De
faultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFa
ctory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFact
ory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFact
ory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSin
gletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitia
lization(AbstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplica
tionContext.java:380)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoade
r.java:255)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.
java:199)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoader
Listener.java:45)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4205)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4704)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1315)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142
)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1061)
  相关解决方案