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

NullPointerException if SOAPMessage Provider endpoint returns null to indicate a one way MEP

    XMLWordPrintable

Details

    • Hide

      1. Create a service provider endpoint using SOAPMessage in MESSAGE mode and return null to indicate a one way MEP (no response required).
      2. Deploy the service to an environment as indicated (JBossAS 5.1.0, JBossESB 4.8, JBossWS-Native 3.3.1).
      3. When the service is invoked (e.g., using soapUI) a NullPointerException will be thrown.

      @ServiceMode(value = Service.Mode.MESSAGE)
      @WebServiceProvider( ... )
      public class MyServiceProviderEndoint implements Provider<SOAPMessage> {
      ...
      SOAPMessage invoke(SOAPMessage request)

      { SOAPMessage response = null; ... // some requests return responses, some do not... // leave response variabl null to indicate one way MEP (no response) ... return response; }

      ...
      }

      Show
      1. Create a service provider endpoint using SOAPMessage in MESSAGE mode and return null to indicate a one way MEP (no response required). 2. Deploy the service to an environment as indicated (JBossAS 5.1.0, JBossESB 4.8, JBossWS-Native 3.3.1). 3. When the service is invoked (e.g., using soapUI) a NullPointerException will be thrown. @ServiceMode(value = Service.Mode.MESSAGE) @WebServiceProvider( ... ) public class MyServiceProviderEndoint implements Provider<SOAPMessage> { ... SOAPMessage invoke(SOAPMessage request) { SOAPMessage response = null; ... // some requests return responses, some do not... // leave response variabl null to indicate one way MEP (no response) ... return response; } ... }
    • Compatibility/Configuration

    Description

      JAX-WS Provider Endpoints are supposed to be able to return 'null' to indicate that it's a one way MEP and no response is needed. Web services ported from the Metro stack will fail on the Native stack if they use this feature because the Native stack seems to be expecting a non-null value to be returned at all times. The API clearly states that null can be returned from invoke() to indicate a one way MEP when no response is required:

      https://jax-ws.dev.java.net/nonav/jax-ws-20-pfd/api/javax/xml/ws/Provider.html#invoke(T)

      On the native stack, when trying to return null from a Provider<SOAPMessage> invoke() operation, a NullPointerException is thrown:

      08:03:32,870 ERROR [RequestHandlerImpl] Error processing web service request
      org.jboss.ws.WSException: java.lang.NullPointerException
      at org.jboss.ws.WSException.rethrow(WSException.java:68)
      at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:362)
      at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:207)
      at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:132)
      at org.jboss.wsf.common.servlet.AbstractEndpointServlet.service(AbstractEndpointServlet.java:87)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.NullPointerException
      at org.jboss.wsf.stack.jbws.RequestHandlerImpl.sendResponse(RequestHandlerImpl.java:435)
      at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:358)
      ... 24 more

      Attachments

        Activity

          People

            rhn-support-asoldano Alessio Soldano
            raycardillo Raymond Cardillo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: