cxf NullPointerException org.apache.cxf.wsdl11.WSDLServiceFactory
sterlingsmith May 7, 2011 1:20 AMHi All,
I'm trying to get a soap client using the cxf / spring framework working; works great from within the Eclipse IDE.
After building it for external use however, I get the following (debug dump follows):
I'd appreciate any clues...could the WSDL be causing this?
-
DEBUG BEGIN
-
May 3, 2011 8:15:07 PM com.novell.iwm.csb.dhcp.DhcpScopeAdd main
May 3, 2011 8:15:07 PM org.springframework.context.support.AbstractApplicationCo
ntext prepareRefresh
INFO: Refreshing org.apache.cxf.bus.spring.BusApplicationContext@781f6226: start
up date Tue May 03 20:15:07 EDT 2011; root of context hierarchy
May 3, 2011 8:15:07 PM org.apache.cxf.bus.spring.BusApplicationContext getConfig
Resources
INFO: Loaded configuration file cxf.xml.
May 3, 2011 8:15:07 PM org.springframework.beans.factory.xml.XmlBeanDefinitionRe
ader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf.xm
l]
May 3, 2011 8:15:07 PM org.springframework.beans.factory.xml.XmlBeanDefinitionRe
ader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource http://cxf.xml/
May 3, 2011 8:15:08 PM org.springframework.beans.factory.xml.XmlBeanDefinitionRe
ader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf.xm
l]
May 3, 2011 8:15:08 PM org.springframework.beans.factory.support.DefaultListable
BeanFactory registerBeanDefinition
INFO: Overriding bean definition for bean 'cxf': replacing [Generic bean: class
http://org.apache.cxf.bus.spring.springbus/; scope=; abstract=false; lazyInit=false; a
utowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factory
BeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=sh
utdown; defined in class path resource http://META-INF/cxf/cxf.xml|http://meta-inf/cxf/cxf.xml]] with [Generic bea
n: class http://org.apache.cxf.bus.spring.springbus/; scope=; abstract=false; lazyInit
=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false
; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMeth
odName=shutdown; defined in class path resource http://META-INF/cxf/cxf.xml|http://meta-inf/cxf/cxf.xml]]
May 3, 2011 8:15:08 PM org.springframework.beans.factory.support.DefaultListable
BeanFactory registerBeanDefinition
INFO: Overriding bean definition for bean 'org.apache.cxf.bus.spring.BusWiringBe
anFactoryPostProcessor': replacing [Generic bean: class [org.apache.cxf.bus.spri
ng.BusWiringBeanFactoryPostProcessor]; scope=; abstract=false; lazyInit=false; a
utowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factory
BeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=nu
ll; defined in class path resource http://META-INF/cxf/cxf.xml|http://meta-inf/cxf/cxf.xml]] with [Generic bean: c
lass http://org.apache.cxf.bus.spring.buswiringbeanfactorypostprocessor/; scope=; abst
ract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate
=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodNa
me=null; destroyMethodName=null; defined in class path resource [META-INF/cxf/cx
f.xml]]
May 3, 2011 8:15:08 PM org.springframework.beans.factory.support.DefaultListable
BeanFactory registerBeanDefinition
INFO: Overriding bean definition for bean 'org.apache.cxf.bus.spring.Jsr250BeanP
ostProcessor': replacing [Generic bean: class [org.apache.cxf.bus.spring.Jsr250B
eanPostProcessor]; scope=; abstract=false; lazyInit=false; autowireMode=0; depen
dencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; facto
ryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class
path resource http://META-INF/cxf/cxf.xml|http://meta-inf/cxf/cxf.xml]] with [Generic bean: class [org.apache.cxf
.bus.spring.Jsr250BeanPostProcessor]; scope=; abstract=false; lazyInit=false; au
towireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryB
eanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=nul
l; defined in class path resource http://META-INF/cxf/cxf.xml|http://meta-inf/cxf/cxf.xml]]
May 3, 2011 8:15:08 PM org.springframework.beans.factory.support.DefaultListable
BeanFactory registerBeanDefinition
INFO: Overriding bean definition for bean 'org.apache.cxf.bus.spring.BusExtensio
nPostProcessor': replacing [Generic bean: class [org.apache.cxf.bus.spring.BusEx
tensionPostProcessor]; scope=; abstract=false; lazyInit=false; autowireMode=0; d
ependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; f
actoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in c
lass path resource http://META-INF/cxf/cxf.xml|http://meta-inf/cxf/cxf.xml]] with [Generic bean: class [org.apache
.cxf.bus.spring.BusExtensionPostProcessor]; scope=; abstract=false; lazyInit=fal
se; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; fa
ctoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodNa
me=null; defined in class path resource http://META-INF/cxf/cxf.xml|http://meta-inf/cxf/cxf.xml]]
May 3, 2011 8:15:08 PM org.springframework.beans.factory.xml.XmlBeanDefinitionRe
ader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-se
rvlet.xml]
May 3, 2011 8:15:08 PM org.springframework.beans.factory.support.DefaultListable
BeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.
DefaultListableBeanFactory@7162e295: defining beans [cxf,org.apache.cxf.bus.spri
ng.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostPro
cessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor]; root of factory hie
rarchy
May 3, 2011 8:15:08 PM com.novell.iwm.csb.dhcp.DhcpScopeAdd main
SEVERE: An exception occurred, exiting [Ljava.lang.StackTraceElement;@68302e67
java.lang.NullPointerException
at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.ja
va:91)
at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:203
)
at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:147)
at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderI
mpl.java:90)
at javax.xml.ws.Service.<init>(Unknown Source)
at com.novell.iwm.csb.cmos.CmosWebServices.<init>(CmosWebServices.java:5
4)
at com.novell.iwm.csb.dhcp.DhcpScopeAdd.main(DhcpScopeAdd.java:143)
-
DEBUG END
-
-
POM BEGIN
-
$/src/main/java</sourceRoot> <wsdlOptions> <wsdlOption> <wsdl>$/src/main/wsdl/CmosWebServices.wsdl$/src/main/resources/bindings.xml
-
POM END
-
-
CXF.XML BEGIN
-
-
CXF.XML END
-
NOTE: I did have the cxf-soap exception XML in the above file, but I received an informational message that it was deprecated on the version I was using so I removed it.
-
BINDINGS.XML BEGIN
-
<jaxb:bindings version="2.0" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<jaxb:globalBindings mapSimpleTypeDef="true">
<xjc:generateElementProperty>false</xjc:generateElementProperty>
</jaxb:globalBindings>
</jaxb:bindings>
-
BINDINGS.XML END
-
NOTE: The wsdl I am using wsdl2java was on Apache Axis, and was generating JAXBElement on the return calls, so this addresses that.
-
CODE SNIPPET THAT CAUSES PROBLEM BEGIN
-
CmosWebServices cmosService = new CmosWebServices();
CmosWebServicesPortType cmosSoap = cmosService.getCmosWebServicesHttpSoap11Endpoint();
-
CODE SNIPPET THAT CAUSES PROBLEM END
-