You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by jsolderitsch <ja...@accenture.com> on 2008/06/11 19:23:18 UTC

junit test with spring and cxf failing -- no bean named cxf is defined

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.


Re: junit test with spring and cxf failing -- no bean named cxf is defined

Posted by jsolderitsch <ja...@accenture.com>.
There is some weird interaction between our beans.xml file and the cxf.xml
that we have for creating the client. I just tried to modify the beans.xml
to use the cxf-all reference in place of the separate cxf individual
references and the war failed to deploy. If I move back to the separate
ones, it deploys. I see in the maven console when I use cxf-all:

[INFO] Configuration problem: Failed to import bean definitions from URL
location [classpath:META-INF/cxf/cxf-all.xml]
[INFO] Offending resource: ServletContext resource [/WEB-INF/beans.xml];
nested exception is
org.springframework.beans.factory.BeanDefinitionStoreException: IOException
parsing XML document from class path resource [META-INF/cxf/cxf-all.xml];
nested exception is java.io.FileNotFoundException: class path resource
[META-INF/cxf/cxf-all.xml] cannot be opened because it does not exist

If I use the separate imports, it works.

A complicating factor I am sure is that we are deploying to the Oracle App
Server.

Glenn has been making helpful posts about issues as I raise them.


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-tp17782928p17784783.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: junit test with spring and cxf failing -- no bean named cxf is defined

Posted by Glen Mazza <gl...@gmail.com>.
Perhaps this is already the case, but, ideally, processing of the
cxf-servlet.xml file and the cxf-all.xml import would 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.


Re: junit test with spring and cxf failing -- no bean named cxf is defined

Posted by Daniel Kulp <dk...@apache.org>.
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





Re: junit test with spring and cxf failing -- no bean named cxf is defined

Posted by jsolderitsch <ja...@accenture.com>.
I am using the pure java version of oc4j -- not the full app server.

Your reference to turn on class loader logging applies to the full app
server. For the pure java version, there is no opmn.xml to add these
settings to.

I guess I will google around to see if there is an alternative.

But thanks for the tip.


Glen Mazza wrote:
> 
> You could be having a classloader problem that is causing this error to
> occur.  OC4J's error messages can be unpredictable when that is happening. 
> I would recommend activating classloader logging[1] to reasonably confirm
> that that is not the problem--but if you see error messages that OC4J
> can't load this jar or that jar, that might be something you need to fix
> first.
> 
> HTH,
> Glen
> 
> [1] http://www.jroller.com/gmazza/date/20060728
> 
> 
> 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-tp17782928p17784415.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: junit test with spring and cxf failing -- no bean named cxf is defined

Posted by Glen Mazza <gl...@gmail.com>.
You could be having a classloader problem that is causing this error to
occur.  OC4J's error messages can be unpredictable when that is happening. 
I would recommend activating classloader logging[1] to reasonably confirm
that that is not the problem--but if you see error messages that OC4J can't
load this jar or that jar, that might be something you need to fix first.

HTH,
Glen

[1] http://www.jroller.com/gmazza/date/20060728


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-tp17782928p17784211.html
Sent from the cxf-user mailing list archive at Nabble.com.