cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rodriguez, José <Jose.Rodrig...@generali.ch>
Subject NullPointerException: CXFBus extensions and WSDLManager.class
Date Thu, 05 Mar 2009 09:19:18 GMT
Hi,

I'm writing a JAX-WS client with cxf 2.0.10 but I have a nasty NullPointerException when using
getBus().getExtension(WSDLManager.class). 

I have found some posts regarding this exception and the solution was to initialize the bus.
But that didn't work for me with my Spring using jaxws:client and my maven setup. I may need
additional jars but no way to find out which ones.

Could someone tell me when and how this extension should be initialized?

Any help will be greatly appreciated.
Regards,
José


Using cxf 2.0.10, here is the exception:
=======================================================================

Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method
[public java.lang.Object org.apache.cxf.frontend.ClientProxyFactoryBean.create()] threw exception;
nested exception is java.lang.NullPointerException
Caused by: java.lang.NullPointerException
	at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:81)
	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:286)
	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:382)
	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:170)
	at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:98)
	at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:98)
	at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:52)
	at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:97)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:118)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:344)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:783)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:710)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:386)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:122)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:66)
	....
=======================================================================




Here is my Spring configuration:
=======================================================================
<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" xmlns:cxf="http://cxf.apache.org/core"
	xsi:schemaLocation="
	http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
	http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
  		   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-2.0.xsd">

	<!--
		http://techpolesen.blogspot.com/2007/09/could-not-find-destination-factory-for.html
	-->
	<import resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml" />

	<cxf:bus>
	</cxf:bus>


	<http:conduit name="*.http-conduit">
		<http:client ProxyServer="XXXXXX" ProxyServerPort="XXXXXXX" />
	</http:conduit>
	

	<jaxws:client id="flexicarclient" serviceClass="XXX.XXXX.XXXXX"
		address="https://XXXXXXXXX"
		wsdlLocation="https://XXXXXXXXXXXwsdl"
		serviceName="s:XXXXXXXXXX"
		xmlns:s="http://XXXXXXX"
		
	/>

</beans>
=======================================================================

My maven pom file:
=======================================================================
<dependencies>
		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-rt-core</artifactId>
			<version>2.0.10</version>
		</dependency>
		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-rt-frontend-jaxws</artifactId>
			<version>2.0.10</version>
		</dependency>
		<dependency>
			<groupId>javax.xml.ws</groupId>
			<artifactId>jaxws-api</artifactId>
			<version>2.0</version>
		</dependency>
		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-rt-transports-http</artifactId>
			<version>2.0.10</version>
		</dependency>
		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-rt-transports-http-jetty</artifactId>
			<version>2.0.10</version>
		</dependency>		
	</dependencies>
=======================================================================




Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message