title: No bean named 'cxf' is defined
body: <p>I am trying to setup a simple restful web application, using tomcat 6.0.32, cxf 2.4.1. Anytime I issue any call, I get back an exception "No bean named 'cxf' is defined", where cxf is my bus.</p>
  
  <p>Looking at the application log, I can see the cxf instance is created, and cached.</p>
  
  <p>================ APP LOG BEGIN======================</p>
  
  <p>910  DEBUG - Creating shared instance of singleton bean 'cxf'</p>
  
  <p>910  DEBUG - Creating instance of bean 'cxf'</p>
  
  <p>1018 DEBUG - Eagerly caching bean 'cxf' to allow for resolving potential circular references</p>
  
  <p>1031 DEBUG - Returning eagerly cached instance of singleton bean 'cxf' that is not fully initialized yet - a consequence of a circular reference</p>
  
  <p>1034 DEBUG - Finished creating instance of bean 'cxf'</p>
  
  <p>1035 DEBUG - Returning cached instance of singleton bean 'org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor'</p>
  
  <p>1035 DEBUG - Returning cached instance of singleton bean 'org.apache.cxf.bus.spring.Jsr250BeanPostProcessor'</p>
  
  <p>1035 DEBUG - Returning cached instance of singleton bean 'org.apache.cxf.bus.spring.BusExtensionPostProcessor'</p>
  
  <p>1035 DEBUG - Creating shared instance of singleton bean 'connection'</p>
  
  <p>1035 DEBUG - Creating instance of bean 'connection'</p>
  
  <p>1035 DEBUG - Eagerly caching bean 'connection' to allow for resolving potential circular references</p>
  
  <p>1052 DEBUG - Finished creating instance of bean 'connection'</p>
  
  <p>1052 DEBUG - Creating shared instance of singleton bean 'connectionService'</p>
  
  <p>1052 DEBUG - Creating instance of bean 'connectionService'</p>
  
  <p>1053 DEBUG - Eagerly caching bean 'connectionService' to allow for resolving potential circular references</p>
  
  <p>1053 DEBUG - Returning cached instance of singleton bean 'connection'</p>
  
  <p>1053 DEBUG - Returning cached instance of singleton bean 'cxf'</p>
  
  <p>1121 DEBUG - Invoking init method  'create' on bean with name 'connectionService'</p>
  
  <p>1356 DEBUG - Finished creating instance of bean 'connectionService'</p>
  
  <p>1384 DEBUG fecycleProcessor with name 'lifecycleProcessor': using default [org.springframework.context.support.DefaultLifecycleProcessor@45d1c3cd]</p>
  
  <p>1385 DEBUG - Returning cached instance of singleton bean 'lifecycleProcessor'</p>
  
  <p>1387 DEBUG - Returning cached instance of singleton bean 'cxf'</p>
  
  <p>1387 DEBUG - Returning cached instance of singleton bean 'cxf'</p>
  
  <p>1388 DEBUG - Invoking init method  'create' on bean with name 'connectionService'</p>
  
  <p>1391 DEBUG - Finished creating instance of bean 'connectionService'</p>
  
  <p>1391 DEBUG - Unable to locate LifecycleProcessor with name 'lifecycleProcessor': using default [org.springframework.context.support.DefaultLifecycleProcessor@2c3299f6]</p>
  
  <p>1391 DEBUG - Returning cached instance of singleton bean 'lifecycleProcessor'</p>
  
  <p>1391 DEBUG - Published root WebApplicationContext as ServletContext attribute with name [org.springframework.web.context.WebApplicationContext.ROOT]</p>
  
  <p>1391 INFO  - Root WebApplicationContext: initialization completed in 1390 ms</p>
  
  <p>================ APP LOG END======================</p>
  
  <p>But when a request comes in, it always fails saying it can't find the bean. </p>
  
  <p>===================== Tomcat (localhost) Log Begin ==================</p>
  
  <p>INFO: Initializing Spring root WebApplicationContext</p>
  
  <p>Jul 14, 2011 8:57:03 AM org.apache.catalina.core.ApplicationContext log</p>
  
  <p>SEVERE: StandardWrapper.Throwable</p>
  
  <p>org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'cxf' is defined</p>
  
  <pre><code>at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:527)
  
  at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1083)
  
  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:274)
  
  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
  
  at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1079)
  
  at org.apache.cxf.transport.servlet.CXFServlet.loadBus(CXFServlet.java:58)
  
  at org.apache.cxf.transport.servlet.CXFNonSpringServlet.init(CXFNonSpringServlet.java:54)
  
  at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
  
  at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:809)
  
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
  
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
  
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
  
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
  
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
  
  at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:864)
  
  at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
  
  at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1665)
  
  at java.lang.Thread.run(Thread.java:662)
  </code></pre>
  
  <p>===================== Tomcat (localhost) Log End ==================</p>
  
  <p>The only thing I can think of is that the bean is inserted in one context, and is being retrieved from another, but can't validate this or find a way around it. Any help would be greatly appreciated.</p>