Uploaded image for project: 'JBoss Web Services'
  1. JBoss Web Services
  2. JBWS-2159

Faults not handled correctly for WS-RM services

XMLWordPrintable

      I am getting a NullPointerException whenever a service with RM support throws a fault.

      The issue seems to to be rooted in the fact that the RMInvocationHandler does not set the RMConstant.RESPONSE_CONTEXT until after the invocation. See below the code from RMInvocationHandler.

      if (inv.getJavaMethod() != null)

      { logger.debug("Invoking method: " + inv.getJavaMethod().getName()); //app fault thrown within, handlerchain handleFault called, no RM ResponseContext for the RMServerHandler to use, end //up with NPE this.delegate.invoke(ep, inv); }

      else

      { logger.debug("RM lifecycle protocol method detected"); }

      setupResponseContext(rmResponseContext); //where the rmresponsecontext is set.

      Here's the stacktrace for the application fault.
      11:45:41,614 WARN [ServiceEndpointInvoker] Exception while processing handleFault: com.cox.wireless.zachsservice.faults.RandomException: An error occurred
      at com.cox.wireless.zachsservice.service.AbstractWebService.doSimple(AbstractWebService.java:93)
      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.jboss.wsf.container.jboss42.DefaultInvocationHandler.invoke(DefaultInvocationHandler.java:102)
      at org.jboss.ws.extensions.wsrm.server.RMInvocationHandler.invoke(RMInvocationHandler.java:324)
      at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:221)
      at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:466)
      at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:284)
      at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:201)
      at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:134)
      at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java:84)

      Here's the stacktrace for the NPE which results.
      11:45:41,614 ERROR [SOAPFaultHelperJAXWS] SOAP request exception javax.xml.ws.WebServiceException: java.lang.NullPointerException
      at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.processHandlerFailure(HandlerChainExecutor.java:276)
      at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleFault(HandlerChainExecutor.java:232)
      at org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS.callFaultHandlerChain(HandlerDelegateJAXWS.java:131)
      at org.jboss.ws.core.server.ServiceEndpointInvoker.callFaultHandlerChain(ServiceEndpointInvoker.java:142)
      at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:286)
      at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:466)
      at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:284)
      at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:201)
      at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:134)
      at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java:84)

              ropalka Richard Opalka
              zach.mabe_jira Zach Mabe (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: