Hi Daniel,

Thanks a lot.

It worked :).

Regards,
J.

-----Message d'origine-----
De : Daniel Kulp [mailto:[email protected]]
Envoyé : vendredi, 6. mars 2009 03:34
À : [email protected]
Cc : Rodriguez, José
Objet : Re: NullPointerException: CXFBus extensions and
WSDLManager.class



Try adding:
<import resource="classpath:META-INF/cxf/cxf.xml" />
before the other import.

If you are creating a full context, you'll need to import that to build the 
whole core.

Dan




On Thu March 5 2009 4:19:18 am Rodriguez, José wrote:
> 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.buildServiceFro
>mWSDL(ReflectionServiceFactoryBean.java:286) at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServi
>ceModel(ReflectionServiceFactoryBean.java:382) at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Reflecti
>onServiceFactoryBean.java:170) at
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFac
>toryBean.java:98) at
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(Abs
>tractWSDLBasedEndpointFactory.java:98) at
> org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:52)
> at
> org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBea
>n.java:97) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3
>9) at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
>l.java:25) at java.lang.reflect.Method.invoke(Method.java:585)
>       at
> org.springframework.beans.factory.support.SimpleInstantiationStrategy.insta
>ntiate(SimpleInstantiationStrategy.java:118) at
> org.springframework.beans.factory.support.ConstructorResolver.instantiateUs
>ingFactoryMethod(ConstructorResolver.java:344) at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactor
>y.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:783)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactor
>y.createBeanInstance(AbstractAutowireCapableBeanFactory.java:710) at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactor
>y.createBean(AbstractAutowireCapableBeanFactory.java:386) at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(A
>bstractBeanFactory.java:249) at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getS
>ingleton(DefaultSingletonBeanRegistry.java:155) at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstr
>actBeanFactory.java:246) at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstr
>actBeanFactory.java:160) at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preIns
>tantiateSingletons(DefaultListableBeanFactory.java:291) at
> org.springframework.context.support.AbstractApplicationContext.refresh(Abst
>ractApplicationContext.java:352) at
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(C
>lassPathXmlApplicationContext.java:122) at
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(C
>lassPathXmlApplicationContext.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-factor
>y-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>
> =======================================================================

-- 
Daniel Kulp
[email protected]
http://www.dankulp.com/blog

Reply via email to