cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Mazza <glen.ma...@gmail.com>
Subject Re: junit test with spring and cxf failing -- no bean named cxf is defined
Date Wed, 11 Jun 2008 20:42:01 GMT

Perhaps this is already the case, but, ideally, processing of the
cxf-servlet.xml file and the cxf-all.xml import should be tied to the same
coding, to make sure they both load the same libraries, and in the same
order.

Glen


dkulp wrote:
> 
> 
> Does it work with the specific imports instead of the cxf-all.xml?
> 
> If so, that suggests a bug in the cxf-all.xml.    That will kind of  
> suck.    Can you copy the contents of cxf-all.xml into your beans file  
> and start adding/removing things until it works?   That may help us  
> figure out what's going on.
> 
> Thanks!
> Dan
> 
> 
> 
> On Jun 11, 2008, at 1:23 PM, jsolderitsch wrote:
> 
>>
>> I have used cxf (2.0.6) to create a mock service implementation AND  
>> a client
>> from a customer wsdl.
>>
>> I can deploy the mock service (to oc4j) and get the wsdl back in the
>> browser.
>>
>> I want to call the client from another web app and so far this is  
>> failing.
>>
>> I have a junit test that I am hoping to use to expose the problem  
>> but I am
>> stumped now by a spring error.
>>
>> The service is accessible via an https url -- ssl seems to be  
>> correctly
>> implemented for the test oc4j instance.
>>
>> When I run the test, I see:
>>
>> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed:  
>> 1.385 sec
>> <<< FAILURE!
>> testHighLevelSimulatorServiceEstablishConnectionTest 
>> (com.gestalt.integration.mde.mdd.SimulatorServiceIntTest)
>> Time elapsed: 1.345 sec  <<< ERROR!
>> java.lang.RuntimeException:
>> org.springframework.beans.factory.BeanCreationException: Error  
>> creating bean
>> with name  
>> 'org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory'
>> defined in class path resource [META-INF/cxf/cxf-extension- 
>> http.xml]: Cannot
>> resolve reference to bean 'cxf' while setting bean property 'bus';  
>> nested
>> exception is
>> org.springframework.beans.factory.NoSuchBeanDefinitionException: No  
>> bean
>> named 'cxf' is defined
>>        at
>> org 
>> .apache 
>> .cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:96)
>>        at
>> org 
>> .apache 
>> .cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:87)
>>        at
>> org 
>> .apache 
>> .cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:65)
>>        at
>> org 
>> .apache 
>> .cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:54)
>>        at org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:69)
>>        at
>> org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:106)
>>        at  
>> org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:97)
>>        at
>> org 
>> .apache 
>> .cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java: 
>> 54)
>>        at javax.xml.ws.Service.<init>(Service.java:57)
>>        at
>> mil 
>> .dod 
>> .metadata 
>> .mdr 
>> .ns 
>> .mde 
>> ._1_0 
>> .ws 
>> .metadatadiscoveryservice 
>> .MetadataDiscoveryService_Service 
>> .<init>(MetadataDiscoveryService_Service.java:41)
>>        at
>> com 
>> .gestalt 
>> .integration 
>> .mde 
>> .mdd 
>> .client 
>> .impl 
>> .MetadataDiscoveryServiceClient 
>> .<init>(MetadataDiscoveryServiceClient.java:16)
>>        at
>> com 
>> .gestalt 
>> .integration 
>> .mde 
>> .mdd 
>> .proxy 
>> .impl 
>> .MetadataDiscoveryServiceProxyImpl 
>> .<init>(MetadataDiscoveryServiceProxyImpl.java:28)
>>        at
>> com 
>> .gestalt 
>> .integration 
>> .mde 
>> .mdd 
>> .SimulatorServiceIntTest 
>> .testHighLevelSimulatorServiceEstablishConnectionTest 
>> (SimulatorServiceIntTest.java:54)
>> Caused by: org.springframework.beans.factory.BeanCreationException:  
>> Error
>> creating bean with name
>> 'org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory'  
>> defined in
>> class path resource [META-INF/cxf/cxf-extension-http.xml]: Cannot  
>> resolve
>> reference to bean 'cxf' while setting bean property 'bus'; nested  
>> exception
>> is org.springframework.beans.factory.NoSuchBeanDefinitionException:  
>> No bean
>> named 'cxf' is defined
>>
>> Our beans file looks like this:
>>
>> <beans xmlns="http://www.springframework.org/schema/beans"
>> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>   xmlns:sec="http://cxf.apache.org/configuration/security"
>>   xmlns:http="http://cxf.apache.org/transports/http/configuration"
>> 	xmlns:jaxws="http://cxf.apache.org/jaxws"
>> 	xsi:schemaLocation="
>>  		   http://cxf.apache.org/configuration/security
>>  		      http://cxf.apache.org/schemas/configuration/security.xsd
>>           http://cxf.apache.org/transports/http/configuration
>>              http://cxf.apache.org/schemas/configuration/http-conf.xsd
>> 	http://www.springframework.org/schema/beans
>> 	http://www.springframework.org/schema/beans/spring-beans.xsd
>> 	http://cxf.apache.org/jaxws
>> 	http://cxf.apache.org/schemas/jaxws.xsd">
>> <!--
>> 	<import resource="classpath:META-INF/cxf/cxf.xml" />
>> 	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
>> 	<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
>> -->
>> 	<import resource="classpath:META-INF/cxf/cxf-all.xml" />
>> 	<jaxws:endpoint
>> 	  id="mdd"
>> 	
>> implementor 
>> = 
>> "com 
>> .gestalt 
>> .integration 
>> .mde.mdd.service.impl.MetadataDiscoveryServiceSimulatedImpl"
>> 	  wsdlLocation="WEB-INF/wsdl/MetadataDiscoveryService.wsdl"
>> 	  address="/service"  />
>>   <http:conduit name="*.http-conduit">
>>       <http:tlsClientParameters secureSocketProtocol="SSL">
>>       </http:tlsClientParameters>
>>       <http:client AutoRedirect="true" Connection="Keep-Alive"/>
>>   </http:conduit>
>>
>> </beans>
>>
>> Note that I just commented out the separate cxf imports in favor of  
>> the
>> cxf-all import.
>>
>> Does this look like I am doing something stupid?
>>
>> Any hints appreciated.
>>
>> Jim
>> -- 
>> View this message in context:
>> http://www.nabble.com/junit-test-with-spring-and-cxf-failing----no-bean-named-cxf-is-defined-tp17782928p17782928.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
> 
> ---
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
> 
> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/junit-test-with-spring-and-cxf-failing----no-bean-named-cxf-is-defined-tp17782928p17786777.html
Sent from the cxf-user mailing list archive at Nabble.com.


Mime
View raw message