CXF Servlet NPE in PerRequestFactory.create(PerRequestFactory.java:56)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

CXF Servlet NPE in PerRequestFactory.create(PerRequestFactory.java:56)

Morein, Arnie
I am implementing a JAX-WS using the following stack:



*        Spring 3.0.7.RELEASE

*        JAXB 2.2.11

*        CXF 3.1.10



Yes, this is an OLD version of Spring, but it cannot be upgraded at this time. I prototyped this service in another, minimal project using:



*        Spring 4.3.9.RELEASE

*        (others the same as above)



The service beans are declared in a Spring configuration XML file:


    <jaxws:endpoint
        id="havaServiceEndpoint"
        implementorClass="gov.texas.dps.dl.dls.ws.hava.service.HavaServiceImpl"
        address="/havaService"

        />



The CXF servlet is registered in web.xml:


    <servlet>
        <servlet-name>CXF Servlet</servlet-name>
        <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
        <load-on-startup>9</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>CXF Servlet</servlet-name>
        <url-pattern>/newservices/*</url-pattern>
    </servlet-mapping>





Though the services compile and deploy w/o issue:


Aug01 12:05:01.657 INFO [ReflectionServiceFactoryBean  ][::] - Creating Service {http://gov.texas.dps/dl/dls/ws/hava}HavaService from class gov.texas.dps.dl.dls.ws.hava.service.HavaService
Aug01 12:05:01.728 INFO [ServerImpl                    ][::] - Setting the server's publish address to be /havaService



When I access the service's ?wsdl URL, a NPE is thrown from inside CXF:


java.lang.NullPointerException
       at org.apache.cxf.service.invoker.PerRequestFactory.create(PerRequestFactory.java:56)
       at org.apache.cxf.service.invoker.SingletonFactory.createBean(SingletonFactory.java:52)
       at org.apache.cxf.service.invoker.SingletonFactory.create(SingletonFactory.java:45)
       at org.apache.cxf.service.invoker.FactoryInvoker.getServiceObject(FactoryInvoker.java:54)
       at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java)
       at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:262)
       at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
       at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
       at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
       at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:180)
       at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:299)
       at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:223)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:618)
...



I don't understand what is going wrong. Accessing the WSDL URL in the test application works just fine.



I've looked at PerRequestFactory.create, but the code means nothing to me.



Can someone suggest what might be going on?


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: CXF Servlet NPE in PerRequestFactory.create(PerRequestFactory.java:56)

Daniel  Kulp
Administrator
This is the part that looks very suspect to me:

>       at org.apache.cxf.service.invoker.FactoryInvoker.getServiceObject(FactoryInvoker.java:54)
>       at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java)
>       at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:262)

First:  the  ChainInitiationObserver.java line doesn’t have a line number yet the others do.   That looks very troubling.  Also makes it hard to figure out what it’s doing.

Second: looking in ChainInitiationObserver, there is NO call to getServiceObject.   I traced back through and I don’t see that call ever in any version of ChainInitiationObserver.  Thus, I have no idea what’s going on.   I would definitely check to make sure you are using proper versions of CXF released by us at Apache.

Dan




> On Aug 1, 2017, at 1:54 PM, Morein, Arnie <[hidden email]> wrote:
>
> I am implementing a JAX-WS using the following stack:
>
>
>
> *        Spring 3.0.7.RELEASE
>
> *        JAXB 2.2.11
>
> *        CXF 3.1.10
>
>
>
> Yes, this is an OLD version of Spring, but it cannot be upgraded at this time. I prototyped this service in another, minimal project using:
>
>
>
> *        Spring 4.3.9.RELEASE
>
> *        (others the same as above)
>
>
>
> The service beans are declared in a Spring configuration XML file:
>
>
>    <jaxws:endpoint
>        id="havaServiceEndpoint"
>        implementorClass="gov.texas.dps.dl.dls.ws.hava.service.HavaServiceImpl"
>        address="/havaService"
>
>        />
>
>
>
> The CXF servlet is registered in web.xml:
>
>
>    <servlet>
>        <servlet-name>CXF Servlet</servlet-name>
>        <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
>        <load-on-startup>9</load-on-startup>
>    </servlet>
>    <servlet-mapping>
>        <servlet-name>CXF Servlet</servlet-name>
>        <url-pattern>/newservices/*</url-pattern>
>    </servlet-mapping>
>
>
>
>
>
> Though the services compile and deploy w/o issue:
>
>
> Aug01 12:05:01.657 INFO [ReflectionServiceFactoryBean  ][::] - Creating Service {http://gov.texas.dps/dl/dls/ws/hava}HavaService from class gov.texas.dps.dl.dls.ws.hava.service.HavaService
> Aug01 12:05:01.728 INFO [ServerImpl                    ][::] - Setting the server's publish address to be /havaService
>
>
>
> When I access the service's ?wsdl URL, a NPE is thrown from inside CXF:
>
>
> java.lang.NullPointerException
>       at org.apache.cxf.service.invoker.PerRequestFactory.create(PerRequestFactory.java:56)
>       at org.apache.cxf.service.invoker.SingletonFactory.createBean(SingletonFactory.java:52)
>       at org.apache.cxf.service.invoker.SingletonFactory.create(SingletonFactory.java:45)
>       at org.apache.cxf.service.invoker.FactoryInvoker.getServiceObject(FactoryInvoker.java:54)
>       at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java)
>       at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:262)
>       at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
>       at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
>       at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
>       at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:180)
>       at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:299)
>       at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:223)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:618)
> ...
>
>
>
> I don't understand what is going wrong. Accessing the WSDL URL in the test application works just fine.
>
>
>
> I've looked at PerRequestFactory.create, but the code means nothing to me.
>
>
>
> Can someone suggest what might be going on?
>
>

--
Daniel Kulp
[hidden email] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: [EXTERNAL] Re: CXF Servlet NPE in PerRequestFactory.create(PerRequestFactory.java:56)

Morein, Arnie
Not sure what the culprit was either, but did a full upgrade to 3.1.12 and all is well.

-----Original Message-----
From: Daniel Kulp [mailto:[hidden email]]
Sent: Tuesday, August 01, 2017 1:21 PM
To: [hidden email]; Morein, Arnie
Subject: [EXTERNAL] Re: CXF Servlet NPE in PerRequestFactory.create(PerRequestFactory.java:56)
Importance: High

This is the part that looks very suspect to me:

>       at org.apache.cxf.service.invoker.FactoryInvoker.getServiceObject(FactoryInvoker.java:54)
>       at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java)
>       at
> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractH
> TTPDestination.java:262)

First:  the  ChainInitiationObserver.java line doesn’t have a line number yet the others do.   That looks very troubling.  Also makes it hard to figure out what it’s doing.

Second: looking in ChainInitiationObserver, there is NO call to getServiceObject.   I traced back through and I don’t see that call ever in any version of ChainInitiationObserver.  Thus, I have no idea what’s going on.   I would definitely check to make sure you are using proper versions of CXF released by us at Apache.

Dan




> On Aug 1, 2017, at 1:54 PM, Morein, Arnie <[hidden email]> wrote:
>
> I am implementing a JAX-WS using the following stack:
>
>
>
> *        Spring 3.0.7.RELEASE
>
> *        JAXB 2.2.11
>
> *        CXF 3.1.10
>
>
>
> Yes, this is an OLD version of Spring, but it cannot be upgraded at this time. I prototyped this service in another, minimal project using:
>
>
>
> *        Spring 4.3.9.RELEASE
>
> *        (others the same as above)
>
>
>
> The service beans are declared in a Spring configuration XML file:
>
>
>    <jaxws:endpoint
>        id="havaServiceEndpoint"
>        implementorClass="gov.texas.dps.dl.dls.ws.hava.service.HavaServiceImpl"
>        address="/havaService"
>
>        />
>
>
>
> The CXF servlet is registered in web.xml:
>
>
>    <servlet>
>        <servlet-name>CXF Servlet</servlet-name>
>        <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
>        <load-on-startup>9</load-on-startup>
>    </servlet>
>    <servlet-mapping>
>        <servlet-name>CXF Servlet</servlet-name>
>        <url-pattern>/newservices/*</url-pattern>
>    </servlet-mapping>
>
>
>
>
>
> Though the services compile and deploy w/o issue:
>
>
> Aug01 12:05:01.657 INFO [ReflectionServiceFactoryBean  ][::] - Creating Service {http://gov.texas.dps/dl/dls/ws/hava}HavaService from class gov.texas.dps.dl.dls.ws.hava.service.HavaService
> Aug01 12:05:01.728 INFO [ServerImpl                    ][::] - Setting the server's publish address to be /havaService
>
>
>
> When I access the service's ?wsdl URL, a NPE is thrown from inside CXF:
>
>
> java.lang.NullPointerException
>       at org.apache.cxf.service.invoker.PerRequestFactory.create(PerRequestFactory.java:56)
>       at org.apache.cxf.service.invoker.SingletonFactory.createBean(SingletonFactory.java:52)
>       at org.apache.cxf.service.invoker.SingletonFactory.create(SingletonFactory.java:45)
>       at org.apache.cxf.service.invoker.FactoryInvoker.getServiceObject(FactoryInvoker.java:54)
>       at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java)
>       at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:262)
>       at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
>       at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
>       at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
>       at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:180)
>       at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:299)
>       at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:223)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:618)
> ...
>
>
>
> I don't understand what is going wrong. Accessing the WSDL URL in the test application works just fine.
>
>
>
> I've looked at PerRequestFactory.create, but the code means nothing to me.
>
>
>
> Can someone suggest what might be going on?
>
>

--
Daniel Kulp
[hidden email] - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com

Loading...