aspose file tools*
The moose likes Tomcat and the fly likes Tomcat  and CXF -> NullPointerException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat  and CXF -> NullPointerException" Watch "Tomcat  and CXF -> NullPointerException" New topic
Author

Tomcat and CXF -> NullPointerException

J. Sailer
Greenhorn

Joined: Jan 23, 2012
Posts: 1
Hello,
we just did an implementation of a webservice-request based on Apache CXF 2.4.5. It is working perfect as long we do not try to use this implemention within any servlet and/or application running on a Tomcat (7.0.11 / 7.0.25). The resulting Stacktrace looks like this:

SCHWERWIEGEND: Servlet.service() for servlet [VrTestServlet] in context with path [/WebTest] threw exception [Servlet execution threw an exception] with root cause
java.lang.NullPointerException
at java.util.ResourceBundle.getBundle(ResourceBundle.java:950)
at org.apache.cxf.common.i18n.BundleUtils.getBundle(BundleUtils.java:80)
at org.apache.cxf.transport.DestinationFactoryManagerImpl.<clinit>(DestinationFactoryManagerImpl.java:41)
at org.apache.cxf.bus.extension.ExtensionManagerBus.<init>(ExtensionManagerBus.java:113)
at org.apache.cxf.bus.extension.ExtensionManagerBus.<init>(ExtensionManagerBus.java:139)
at org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:40)
at org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:36)
at org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:32)
at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:115)
at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:91)
at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:69)
at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:58)
at org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:99)
at org.apache.cxf.BusFactory.createThreadBus(BusFactory.java:165)
at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:155)
at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:140)
at org.apache.cxf.frontend.ClientProxyFactoryBean.configureObject(ClientProxyFactoryBean.java:99)
at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:131)
at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:153)
at com.weltbild.commons.ws.cxf.CXFProxyFactory.create(CXFProxyFactory.java:372)
at com.weltbild.visualrules.service.CustomerInfoProxy.<init>(CustomerInfoProxy.java:64)
at com.weltbild.VrTestServlet.doGet(VrTestServlet.java:71)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)

Some Google-searches tended to a versioning-conflict, but we tried a lot of different versions of CXF, always getting more or less the same stacktrace. While debugging we discoverd, that it seems to be a problem of the classloader, which does not find the META_INF/cxf/cxf.extensions ressources, that leads to the NPE.

Do you have any idea ?

Thanks

Joerg
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat and CXF -> NullPointerException