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 <js...@gestalt-llc.com> on 2008/06/04 22:55:54 UTC

javax.xml.ws.WebServiceException: java.lang.NullPointerException with cxf 2.0.6

I have a bean definition like this:

<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:jaxws="http://cxf.apache.org/jaxws"
	xsi:schemaLocation="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" />

	<jaxws:endpoint
	  id="mdd"
	 
implementor="com.gestalt.integration.mde.mdd.service.impl.MetadataDiscoveryServiceSimulatedImpl" 
	  address="/service" />

</beans>

We just made some changes to the Impl method class and now when we try to
deploy to our oc4j server, we get the following:

[ERROR] - Context initialization failed
(ContextLoader.java:initWebApplicationContext:204)
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'mdd': Invocation of init method failed; nested exception is
javax.xml.ws.WebServiceException: java.lang.NullPointerException
Caused by: 
javax.xml.ws.WebServiceException: java.lang.NullPointerException
        at
org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:249)
        at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:185)
        at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:366)
        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.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1242)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1208)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1172)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
        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.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
        at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:189)
        at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
        at
com.gestalt.integration.mde.mdd.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:19)
        at
com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:1141)
        at
com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:741)
        at
com.evermind.server.ApplicationStateRunning.getHttpApplication(ApplicationStateRunning.java:414)
        at
com.evermind.server.Application.getHttpApplication(Application.java:570)
        at
com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.createHttpApplicationFromReference(HttpSite.java:1987)
        at
com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.<init>(HttpSite.java:1906)
        at
com.evermind.server.http.HttpSite.addHttpApplication(HttpSite.java:1603)
        at
oracle.oc4j.admin.internal.WebApplicationBinder.bindWebApp(WebApplicationBinder.java:238)
        at
oracle.oc4j.admin.internal.WebApplicationBinder.bindWebApp(WebApplicationBinder.java:99)
        at
oracle.oc4j.admin.internal.ApplicationDeployer.bindWebApp(ApplicationDeployer.java:547)
        at
oracle.oc4j.admin.internal.ApplicationDeployer.doDeploy(ApplicationDeployer.java:202)
        at
oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:93)
        at
oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(OC4JDeployerRunnable.java:52)
        at
oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerRunnable.java:81)
        at
com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
        at java.lang.Thread.run(Thread.java:613)
Caused by: java.lang.NullPointerException
        at
com.sun.xml.txw2.ContainerElement.addChild(ContainerElement.java:225)
        at
com.sun.xml.txw2.ContainerElement._element(ContainerElement.java:336)
        at
com.sun.xml.txw2.ContainerElement.addElement(ContainerElement.java:196)
        at
com.sun.xml.txw2.ContainerElement.invoke(ContainerElement.java:123)
        at $Proxy135.anyAttribute(Unknown Source)
        at
com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator$Namespace.writeClass(XmlSchemaGenerator.java:787)
        at
com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator$Namespace.writeTo(XmlSchemaGenerator.java:497)
        at
com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator$Namespace.access$600(XmlSchemaGenerator.java:341)
        at
com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator.write(XmlSchemaGenerator.java:322)
        at
com.sun.xml.bind.v2.runtime.JAXBContextImpl.generateSchema(JAXBContextImpl.java:767)
        at
org.apache.cxf.jaxb.JAXBDataBinding.generateJaxbSchemas(JAXBDataBinding.java:365)
        at
org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:318)
        at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:319)
        at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:370)
        at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:162)
        at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:97)
        at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:74)
        at
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:114)
        at
org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:160)
        at
org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:313)
        at
org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:235)
        ... 36 more

Prior to to the impl changes the deployment succeeds.

We are still using jaxb-api-2.0.

Does this look like a known problem?

Would there be any benefit to updating to cxf 2.1 and a newer jaxb?

The web site that documents making oc4j changes to accomodate cxf:
http://cwiki.apache.org/CXF20DOC/appserverguide.html
seems out of date with respect to cxf 2.1 so I am a little uncertain about
trying to use 2.1.

Any advice appreciated.


-- 
View this message in context: http://www.nabble.com/javax.xml.ws.WebServiceException%3A-java.lang.NullPointerException-with-cxf-2.0.6-tp17656441p17656441.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: javax.xml.ws.WebServiceException: java.lang.NullPointerException with cxf 2.0.6

Posted by Daniel Kulp <dk...@apache.org>.
I really have no idea what might cause that.   That said, you COULD  
just update the jaxb version with cxf 2.0.6.   We have done some  
testing with using JAXB 2.1 with CXF 2.0.x.   It obviously doesn't  
pass the TCK and such that way, but it should work.   Just replace the  
2.0.x jars with the 2.1 jars, make sure any classpath things are  
updated, and re-run.   (note: the cxf-manifest jar points to the 2.0.x  
versions.   Since the command line tools only look at the manifest  
jar, you may need to update those scripts to add the new jaxb jars).

Dan



On Jun 4, 2008, at 4:55 PM, jsolderitsch wrote:

>
> I have a bean definition like this:
>
> <beans xmlns="http://www.springframework.org/schema/beans"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xmlns:jaxws="http://cxf.apache.org/jaxws"
> 	xsi:schemaLocation="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" />
>
> 	<jaxws:endpoint
> 	  id="mdd"
> 	
> implementor 
> = 
> "com 
> .gestalt 
> .integration 
> .mde.mdd.service.impl.MetadataDiscoveryServiceSimulatedImpl"
> 	  address="/service" />
>
> </beans>
>
> We just made some changes to the Impl method class and now when we  
> try to
> deploy to our oc4j server, we get the following:
>
> [ERROR] - Context initialization failed
> (ContextLoader.java:initWebApplicationContext:204)
> org.springframework.beans.factory.BeanCreationException: Error  
> creating bean
> with name 'mdd': Invocation of init method failed; nested exception is
> javax.xml.ws.WebServiceException: java.lang.NullPointerException
> Caused by:
> javax.xml.ws.WebServiceException: java.lang.NullPointerException
>        at
> org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:249)
>        at  
> org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:185)
>        at  
> org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:366)
>        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 
> .AbstractAutowireCapableBeanFactory 
> .invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1242)
>        at
> org 
> .springframework 
> .beans 
> .factory 
> .support 
> .AbstractAutowireCapableBeanFactory 
> .invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1208)
>        at
> org 
> .springframework 
> .beans 
> .factory 
> .support 
> .AbstractAutowireCapableBeanFactory 
> .initializeBean(AbstractAutowireCapableBeanFactory.java:1172)
>        at
> org 
> .springframework 
> .beans 
> .factory 
> .support 
> .AbstractAutowireCapableBeanFactory 
> .createBean(AbstractAutowireCapableBeanFactory.java:427)
>        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.web.context.ContextLoader.createWebApplicationContext 
> (ContextLoader.java:246)
>        at
> org.springframework.web.context.ContextLoader.initWebApplicationContext 
> (ContextLoader.java:189)
>        at
> org.springframework.web.context.ContextLoaderListener.contextInitialized 
> (ContextLoaderListener.java:49)
>        at
> com 
> .gestalt 
> .integration 
> .mde 
> .mdd 
> .ContextLoaderListener.contextInitialized(ContextLoaderListener.java: 
> 19)
>        at
> com 
> .evermind 
> .server.http.HttpApplication.initDynamic(HttpApplication.java:1141)
>        at
> com.evermind.server.http.HttpApplication.<init>(HttpApplication.java: 
> 741)
>        at
> com 
> .evermind 
> .server 
> .ApplicationStateRunning 
> .getHttpApplication(ApplicationStateRunning.java:414)
>        at
> com.evermind.server.Application.getHttpApplication(Application.java: 
> 570)
>        at
> com.evermind.server.http.HttpSite 
> $ 
> HttpApplicationRunTimeReference 
> .createHttpApplicationFromReference(HttpSite.java:1987)
>        at
> com.evermind.server.http.HttpSite 
> $HttpApplicationRunTimeReference.<init>(HttpSite.java:1906)
>        at
> com.evermind.server.http.HttpSite.addHttpApplication(HttpSite.java: 
> 1603)
>        at
> oracle 
> .oc4j 
> .admin 
> .internal.WebApplicationBinder.bindWebApp(WebApplicationBinder.java: 
> 238)
>        at
> oracle 
> .oc4j 
> .admin 
> .internal.WebApplicationBinder.bindWebApp(WebApplicationBinder.java: 
> 99)
>        at
> oracle 
> .oc4j 
> .admin 
> .internal.ApplicationDeployer.bindWebApp(ApplicationDeployer.java:547)
>        at
> oracle 
> .oc4j 
> .admin 
> .internal.ApplicationDeployer.doDeploy(ApplicationDeployer.java:202)
>        at
> oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:93)
>        at
> oracle 
> .oc4j 
> .admin 
> .jmx 
> .server 
> .mbeans.deploy.OC4JDeployerRunnable.doRun(OC4JDeployerRunnable.java: 
> 52)
>        at
> oracle 
> .oc4j 
> .admin 
> .jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerRunnable.java: 
> 81)
>        at
> com.evermind.util.ReleasableResourcePooledExecutor 
> $MyWorker.run(ReleasableResourcePooledExecutor.java:303)
>        at java.lang.Thread.run(Thread.java:613)
> Caused by: java.lang.NullPointerException
>        at
> com.sun.xml.txw2.ContainerElement.addChild(ContainerElement.java:225)
>        at
> com.sun.xml.txw2.ContainerElement._element(ContainerElement.java:336)
>        at
> com.sun.xml.txw2.ContainerElement.addElement(ContainerElement.java: 
> 196)
>        at
> com.sun.xml.txw2.ContainerElement.invoke(ContainerElement.java:123)
>        at $Proxy135.anyAttribute(Unknown Source)
>        at
> com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator 
> $Namespace.writeClass(XmlSchemaGenerator.java:787)
>        at
> com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator 
> $Namespace.writeTo(XmlSchemaGenerator.java:497)
>        at
> com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator$Namespace.access 
> $600(XmlSchemaGenerator.java:341)
>        at
> com 
> .sun 
> .xml 
> .bind.v2.schemagen.XmlSchemaGenerator.write(XmlSchemaGenerator.java: 
> 322)
>        at
> com 
> .sun 
> .xml 
> .bind.v2.runtime.JAXBContextImpl.generateSchema(JAXBContextImpl.java: 
> 767)
>        at
> org 
> .apache 
> .cxf.jaxb.JAXBDataBinding.generateJaxbSchemas(JAXBDataBinding.java: 
> 365)
>        at
> org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java: 
> 318)
>        at
> org 
> .apache 
> .cxf 
> .service 
> .factory 
> .ReflectionServiceFactoryBean 
> .buildServiceFromClass(ReflectionServiceFactoryBean.java:319)
>        at
> org 
> .apache 
> .cxf 
> .service 
> .factory 
> .ReflectionServiceFactoryBean 
> .initializeServiceModel(ReflectionServiceFactoryBean.java:370)
>        at
> org 
> .apache 
> .cxf 
> .service 
> .factory 
> .ReflectionServiceFactoryBean 
> .create(ReflectionServiceFactoryBean.java:162)
>        at
> org 
> .apache 
> .cxf 
> .jaxws 
> .support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java: 
> 97)
>        at
> org 
> .apache 
> .cxf 
> .frontend 
> .AbstractWSDLBasedEndpointFactory 
> .createEndpoint(AbstractWSDLBasedEndpointFactory.java:74)
>        at
> org 
> .apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java: 
> 114)
>        at
> org 
> .apache 
> .cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java: 
> 160)
>        at
> org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:313)
>        at
> org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:235)
>        ... 36 more
>
> Prior to to the impl changes the deployment succeeds.
>
> We are still using jaxb-api-2.0.
>
> Does this look like a known problem?
>
> Would there be any benefit to updating to cxf 2.1 and a newer jaxb?
>
> The web site that documents making oc4j changes to accomodate cxf:
> http://cwiki.apache.org/CXF20DOC/appserverguide.html
> seems out of date with respect to cxf 2.1 so I am a little uncertain  
> about
> trying to use 2.1.
>
> Any advice appreciated.
>
>
> -- 
> View this message in context: http://www.nabble.com/javax.xml.ws.WebServiceException%3A-java.lang.NullPointerException-with-cxf-2.0.6-tp17656441p17656441.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>

---
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog