Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-335

SaajXmlReader NullPointerException / jboss / mac in interceptors

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: 1.5.1
    • Component/s: None
    • Labels:
      None
    • Environment:
      Mac OSX 10.5.2 / JBoss 4.2.2 / Java 1.5

      Description

      run my app in the jboss environment (JBoss 4.2.2GA) I always fail with nullpointer exceptions in one of my payload interceptors (PayloadLoggingInterceptor, PayloadValidatingInterceptor).
      When I have validation turned on, I fail in xerces, if it's off I fail the logger in xalan.

      See stacktraces, failure in validator:
      Code:

      java.lang.NullPointerException
      at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleText(SaajXmlReader.java:187)
      at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleNode(SaajXmlReader.java:127)
      at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleElement(SaajXmlReader.java:150)
      at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleNode(SaajXmlReader.java:123)
      at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleElement(SaajXmlReader.java:150)
      at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleNode(SaajXmlReader.java:123)
      at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleElement(SaajXmlReader.java:150)
      at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleNode(SaajXmlReader.java:123)
      at org.springframework.ws.soap.saaj.support.SaajXmlReader.parse(SaajXmlReader.java:115)
      at org.springframework.ws.soap.saaj.support.SaajXmlReader.parse(SaajXmlReader.java:96)
      at org.apache.xerces.jaxp.validation.ValidatorHandlerImpl.validate(Unknown Source)
      at org.apache.xerces.jaxp.validation.ValidatorImpl.validate(Unknown Source)
      at javax.xml.validation.Validator.validate(Unknown Source)
      at org.springframework.xml.validation.Jaxp13ValidatorFactory$Jaxp13Validator.validate(Jaxp13ValidatorFactory.java:61)
      at org.springframework.ws.server.endpoint.interceptor.AbstractValidatingInterceptor.handleResponse(AbstractValidatingInterceptor.java:185)
      at org.springframework.ws.server.MessageDispatcher.triggerHandleResponse(MessageDispatcher.java:341)
      at org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:218)
      at org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:162)
      at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:87)
      at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:57)
      at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:197)
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
      at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:441)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      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:230)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      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:157)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)

      failure in logger:
      Code:

      14:57:46,159 INFO [STDOUT] 2008-04-07 14:57:46,158 WARN [org.springframework.ws.soap.server.SoapMessageDispatcher] - Endpoint invocation resulted in exception - responding with SOAP Fault
      java.lang.NullPointerException
      at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleText(SaajXmlReader.java:187)
      at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleNode(SaajXmlReader.java:127)
      at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleElement(SaajXmlReader.java:150)
      at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleNode(SaajXmlReader.java:123)
      at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleElement(SaajXmlReader.java:150)
      at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleNode(SaajXmlReader.java:123)
      at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleElement(SaajXmlReader.java:150)
      at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleNode(SaajXmlReader.java:123)
      at org.springframework.ws.soap.saaj.support.SaajXmlReader.parse(SaajXmlReader.java:115)
      at org.springframework.ws.soap.saaj.support.SaajXmlReader.parse(SaajXmlReader.java:96)
      at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:485)
      at org.springframework.ws.server.endpoint.1.logMessageSource(AbstractLoggingInterceptor.java:102)
      at org.springframework.ws.server.endpoint.AbstractLoggingInterceptor.handleResponse(AbstractLoggingInterceptor.java:81)
      at org.springframework.ws.server.MessageDispatcher.triggerHandleResponse(MessageDispatcher.java:341)
      at org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:218)
      at org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:162)
      at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:87)
      at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:57)
      at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:197)
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
      at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:441)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      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:230)
      at ... snip

      my bean looks like this,
      Code:

      <bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping">
      <property name="interceptors">
      <list>
      <bean class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor"/>
      <bean class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor">
      <property name="schema" value="/WEB-INF/xsd/codexws.xsd"/>
      <property name="validateRequest" value="true"/>
      <property name="validateResponse" value="true"/>
      </bean>
      </list>
      </property>
      <property name="order" value="1"/>
      </bean>

      I have explicitly defined the message factory:
      Code:

      <bean id="messageFactory"
      class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory">
      <description>
      define default message factory to avoid problems with JBoss'
      built in factory. See http://static.springframework.org/spring-ws/site/faq.html#saaj-jboss
      </description>
      <property name="messageFactory">
      <bean
      class="com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl">
      </bean>
      </property>
      </bean>

        Activity

        couzteau Jacques Couzteau created issue -
        arjen.poutsma Arjen Poutsma made changes -
        Field Original Value New Value
        Fix Version/s 1.5.1 [ 10917 ]
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        I'm looking at line 187 of SaajXmlReader, but I honestly can see anything that can cause a NPE. Are you sure you're running Spring-WS 1.5.0?

        Show
        arjen.poutsma Arjen Poutsma added a comment - I'm looking at line 187 of SaajXmlReader, but I honestly can see anything that can cause a NPE. Are you sure you're running Spring-WS 1.5.0?
        Hide
        couzteau Jacques Couzteau added a comment -

        The stack trace was probaly not 1.5, but I cn repro with 1.5: Here is the stacktrace, crashes in 171 now:

        18:49:31,501 INFO [STDOUT] 2008-04-19 18:49:31,500 DEBUG [org.springframework.ws.soap.server.SoapMessageDispatcher] - Endpoint invocation resulted in exception - responding with Fault
        java.lang.NullPointerException
        at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleText(SaajXmlReader.java:171)
        at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleNode(SaajXmlReader.java:129)
        at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleElement(SaajXmlReader.java:152)
        at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleNode(SaajXmlReader.java:125)
        at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleElement(SaajXmlReader.java:152)
        at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleNode(SaajXmlReader.java:125)
        at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleElement(SaajXmlReader.java:152)
        at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleNode(SaajXmlReader.java:125)
        at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleElement(SaajXmlReader.java:152)
        at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleNode(SaajXmlReader.java:125)
        at org.springframework.ws.soap.saaj.support.SaajXmlReader.parse(SaajXmlReader.java:117)
        at org.springframework.ws.soap.saaj.support.SaajXmlReader.parse(SaajXmlReader.java:98)
        at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.process(ValidatorImpl.java:192)
        at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate(ValidatorImpl.java:147)

        Show
        couzteau Jacques Couzteau added a comment - The stack trace was probaly not 1.5, but I cn repro with 1.5: Here is the stacktrace, crashes in 171 now: 18:49:31,501 INFO [STDOUT] 2008-04-19 18:49:31,500 DEBUG [org.springframework.ws.soap.server.SoapMessageDispatcher] - Endpoint invocation resulted in exception - responding with Fault java.lang.NullPointerException at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleText(SaajXmlReader.java:171) at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleNode(SaajXmlReader.java:129) at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleElement(SaajXmlReader.java:152) at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleNode(SaajXmlReader.java:125) at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleElement(SaajXmlReader.java:152) at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleNode(SaajXmlReader.java:125) at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleElement(SaajXmlReader.java:152) at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleNode(SaajXmlReader.java:125) at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleElement(SaajXmlReader.java:152) at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleNode(SaajXmlReader.java:125) at org.springframework.ws.soap.saaj.support.SaajXmlReader.parse(SaajXmlReader.java:117) at org.springframework.ws.soap.saaj.support.SaajXmlReader.parse(SaajXmlReader.java:98) at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.process(ValidatorImpl.java:192) at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate(ValidatorImpl.java:147)
        arjen.poutsma Arjen Poutsma made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Fixed in SVN.

        The mystery that remains is that the SaajXmlReader is only supposed to be used under SAAJ 1.1 (See Saaj11Implementation), but the MessageFactory implementation you configure (SOAPMessageFactory1_1Impl) indicates at least SAAJ 1.2. This might be due to having a SAAJ 1.1 API jar on the classpath somewhere.

        Show
        arjen.poutsma Arjen Poutsma added a comment - Fixed in SVN. The mystery that remains is that the SaajXmlReader is only supposed to be used under SAAJ 1.1 (See Saaj11Implementation), but the MessageFactory implementation you configure (SOAPMessageFactory1_1Impl) indicates at least SAAJ 1.2. This might be due to having a SAAJ 1.1 API jar on the classpath somewhere.
        arjen.poutsma Arjen Poutsma made changes -
        Resolution Fixed [ 1 ]
        Status In Progress [ 3 ] Resolved [ 5 ]
        Hide
        couzteau Jacques Couzteau added a comment -

        thanks Arjen.

        Show
        couzteau Jacques Couzteau added a comment - thanks Arjen.
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Closing issues for 1.5.1

        Show
        arjen.poutsma Arjen Poutsma added a comment - Closing issues for 1.5.1
        arjen.poutsma Arjen Poutsma made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        9d 17h 2m 1 Arjen Poutsma 27/Apr/08 12:01 AM
        In Progress In Progress Resolved Resolved
        1h 7m 1 Arjen Poutsma 27/Apr/08 1:08 AM
        Resolved Resolved Closed Closed
        8d 20h 12m 1 Arjen Poutsma 05/May/08 9:21 PM

          People

          • Assignee:
            arjen.poutsma Arjen Poutsma
            Reporter:
            couzteau Jacques Couzteau
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: