java.lang.NullPointerException: null

Spring JIRA | Martin Wegner | 3 years ago
  1. 0

    What you need: 1.) An endpoint with SOAP action mapping and payload root mapping. 2.) An interceptor for the payload root mapping. When you send a message with a SOAP action and an empty SOAP body, then you will get a null pointer exception. Problem is in PayloadRootSmartSoapEndpointInterceptor line 61/62: {code:java} QName payloadRootName = PayloadRootUtils.getPayloadRootQName(request.getPayloadSource(), transformerHelper); if (!namespaceUri.equals(payloadRootName.getNamespaceURI())) { {code} The variable payloadRootName is null if the SOAP body is empty. {noformat} Stack trace (the NullPointerException is logged at DEBUG level...): DEBUG o.s.w.s.s.SoapMessageDispatcher MessageDispatcher.processEndpointException:333 - Endpoint invocation resulted in exception - responding with Fault java.lang.NullPointerException: null at org.springframework.ws.soap.server.endpoint.interceptor.PayloadRootSmartSoapEndpointInterceptor.shouldIntercept(PayloadRootSmartSoapEndpointInterceptor.java:62) ~[spring-ws-2.1.4.RELEASE-all.jar:2.1.4.RELEASE] at org.springframework.ws.server.endpoint.interceptor.DelegatingSmartEndpointInterceptor.shouldIntercept(DelegatingSmartEndpointInterceptor.java:61) ~[spring-ws-2.1.4.RELEASE-all.jar:2.1.4.RELEASE] at org.springframework.ws.server.endpoint.mapping.AbstractEndpointMapping.getEndpoint(AbstractEndpointMapping.java:139) ~[spring-ws-2.1.4.RELEASE-all.jar:2.1.4.RELEASE] at org.springframework.ws.server.MessageDispatcher.getEndpoint(MessageDispatcher.java:269) [spring-ws-2.1.4.RELEASE-all.jar:2.1.4.RELEASE] at org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:212) [spring-ws-2.1.4.RELEASE-all.jar:2.1.4.RELEASE] at org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:173) [spring-ws-2.1.4.RELEASE-all.jar:2.1.4.RELEASE] at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:88) [spring-ws-2.1.4.RELEASE-all.jar:2.1.4.RELEASE] at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:59) [spring-ws-2.1.4.RELEASE-all.jar:2.1.4.RELEASE] at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:292) [spring-ws-2.1.4.RELEASE-all.jar:2.1.4.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:931) [spring-webmvc-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:833) [spring-webmvc-4.0.0.RELEASE.jar:4.0.0.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:647) [servlet-api.jar:na] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:807) [spring-webmvc-4.0.0.RELEASE.jar:4.0.0.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) [servlet-api.jar:na] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) [catalina.jar:7.0.47] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [catalina.jar:7.0.47] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) [tomcat7-websocket.jar:7.0.47] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) [catalina.jar:7.0.47] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [catalina.jar:7.0.47] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) [catalina.jar:7.0.47] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) [catalina.jar:7.0.47] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:611) [catalina.jar:7.0.47] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) [catalina.jar:7.0.47] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) [catalina.jar:7.0.47] at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) [catalina.jar:7.0.47] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) [catalina.jar:7.0.47] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) [catalina.jar:7.0.47] at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041) [tomcat-coyote.jar:7.0.47] at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603) [tomcat-coyote.jar:7.0.47] at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2430) [tomcat-coyote.jar:7.0.47] at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2419) [tomcat-coyote.jar:7.0.47] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.7.0_45] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.7.0_45] at java.lang.Thread.run(Unknown Source) [na:1.7.0_45] {noformat}

    Spring JIRA | 3 years ago | Martin Wegner
    java.lang.NullPointerException: null
  2. 0

    What you need: 1.) An endpoint with SOAP action mapping and payload root mapping. 2.) An interceptor for the payload root mapping. When you send a message with a SOAP action and an empty SOAP body, then you will get a null pointer exception. Problem is in PayloadRootSmartSoapEndpointInterceptor line 61/62: {code:java} QName payloadRootName = PayloadRootUtils.getPayloadRootQName(request.getPayloadSource(), transformerHelper); if (!namespaceUri.equals(payloadRootName.getNamespaceURI())) { {code} The variable payloadRootName is null if the SOAP body is empty. {noformat} Stack trace (the NullPointerException is logged at DEBUG level...): DEBUG o.s.w.s.s.SoapMessageDispatcher MessageDispatcher.processEndpointException:333 - Endpoint invocation resulted in exception - responding with Fault java.lang.NullPointerException: null at org.springframework.ws.soap.server.endpoint.interceptor.PayloadRootSmartSoapEndpointInterceptor.shouldIntercept(PayloadRootSmartSoapEndpointInterceptor.java:62) ~[spring-ws-2.1.4.RELEASE-all.jar:2.1.4.RELEASE] at org.springframework.ws.server.endpoint.interceptor.DelegatingSmartEndpointInterceptor.shouldIntercept(DelegatingSmartEndpointInterceptor.java:61) ~[spring-ws-2.1.4.RELEASE-all.jar:2.1.4.RELEASE] at org.springframework.ws.server.endpoint.mapping.AbstractEndpointMapping.getEndpoint(AbstractEndpointMapping.java:139) ~[spring-ws-2.1.4.RELEASE-all.jar:2.1.4.RELEASE] at org.springframework.ws.server.MessageDispatcher.getEndpoint(MessageDispatcher.java:269) [spring-ws-2.1.4.RELEASE-all.jar:2.1.4.RELEASE] at org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:212) [spring-ws-2.1.4.RELEASE-all.jar:2.1.4.RELEASE] at org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:173) [spring-ws-2.1.4.RELEASE-all.jar:2.1.4.RELEASE] at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:88) [spring-ws-2.1.4.RELEASE-all.jar:2.1.4.RELEASE] at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:59) [spring-ws-2.1.4.RELEASE-all.jar:2.1.4.RELEASE] at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:292) [spring-ws-2.1.4.RELEASE-all.jar:2.1.4.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:931) [spring-webmvc-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:833) [spring-webmvc-4.0.0.RELEASE.jar:4.0.0.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:647) [servlet-api.jar:na] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:807) [spring-webmvc-4.0.0.RELEASE.jar:4.0.0.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) [servlet-api.jar:na] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) [catalina.jar:7.0.47] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [catalina.jar:7.0.47] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) [tomcat7-websocket.jar:7.0.47] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) [catalina.jar:7.0.47] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [catalina.jar:7.0.47] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) [catalina.jar:7.0.47] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) [catalina.jar:7.0.47] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:611) [catalina.jar:7.0.47] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) [catalina.jar:7.0.47] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) [catalina.jar:7.0.47] at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) [catalina.jar:7.0.47] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) [catalina.jar:7.0.47] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) [catalina.jar:7.0.47] at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041) [tomcat-coyote.jar:7.0.47] at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603) [tomcat-coyote.jar:7.0.47] at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2430) [tomcat-coyote.jar:7.0.47] at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2419) [tomcat-coyote.jar:7.0.47] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.7.0_45] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.7.0_45] at java.lang.Thread.run(Unknown Source) [na:1.7.0_45] {noformat}

    Spring JIRA | 3 years ago | Martin Wegner
    java.lang.NullPointerException: null
  3. 0
    Elasticsearch 1.x and 2.x nodes are not compatible, make sure your setup contains nodes of the same major version.
    via GitHub by dakrone
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0
    It is a JDK bug, no workaround currently.
    via GitHub by jroper
  6. 0
    Some of the parametes ar enull

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      null

      at org.springframework.ws.soap.server.endpoint.interceptor.PayloadRootSmartSoapEndpointInterceptor.shouldIntercept()
    2. Spring WS Core
      MessageDispatcherServlet.doService
      1. org.springframework.ws.soap.server.endpoint.interceptor.PayloadRootSmartSoapEndpointInterceptor.shouldIntercept(PayloadRootSmartSoapEndpointInterceptor.java:62)[spring-ws-2.1.4.RELEASE-all.jar:2.1.4.RELEASE]
      2. org.springframework.ws.server.endpoint.interceptor.DelegatingSmartEndpointInterceptor.shouldIntercept(DelegatingSmartEndpointInterceptor.java:61)[spring-ws-2.1.4.RELEASE-all.jar:2.1.4.RELEASE]
      3. org.springframework.ws.server.endpoint.mapping.AbstractEndpointMapping.getEndpoint(AbstractEndpointMapping.java:139)[spring-ws-2.1.4.RELEASE-all.jar:2.1.4.RELEASE]
      4. org.springframework.ws.server.MessageDispatcher.getEndpoint(MessageDispatcher.java:269)[spring-ws-2.1.4.RELEASE-all.jar:2.1.4.RELEASE]
      5. org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:212)[spring-ws-2.1.4.RELEASE-all.jar:2.1.4.RELEASE]
      6. org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:173)[spring-ws-2.1.4.RELEASE-all.jar:2.1.4.RELEASE]
      7. org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:88)[spring-ws-2.1.4.RELEASE-all.jar:2.1.4.RELEASE]
      8. org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:59)[spring-ws-2.1.4.RELEASE-all.jar:2.1.4.RELEASE]
      9. org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:292)[spring-ws-2.1.4.RELEASE-all.jar:2.1.4.RELEASE]
      9 frames
    3. Spring MVC
      FrameworkServlet.doPost
      1. org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:931)[spring-webmvc-4.0.0.RELEASE.jar:4.0.0.RELEASE]
      2. org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:833)[spring-webmvc-4.0.0.RELEASE.jar:4.0.0.RELEASE]
      2 frames
    4. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:647)[servlet-api.jar:na]
      1 frame
    5. Spring MVC
      FrameworkServlet.service
      1. org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:807)[spring-webmvc-4.0.0.RELEASE.jar:4.0.0.RELEASE]
      1 frame
    6. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:728)[servlet-api.jar:na]
      1 frame
    7. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)[catalina.jar:7.0.47]
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)[catalina.jar:7.0.47]
      2 frames
    8. Tomcat WS
      WsFilter.doFilter
      1. org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)[tomcat7-websocket.jar:7.0.47]
      1 frame
    9. Glassfish Core
      CoyoteAdapter.service
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)[catalina.jar:7.0.47]
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)[catalina.jar:7.0.47]
      3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)[catalina.jar:7.0.47]
      4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)[catalina.jar:7.0.47]
      5. org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:611)[catalina.jar:7.0.47]
      6. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)[catalina.jar:7.0.47]
      7. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)[catalina.jar:7.0.47]
      8. org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)[catalina.jar:7.0.47]
      9. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)[catalina.jar:7.0.47]
      10. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)[catalina.jar:7.0.47]
      10 frames
    10. Grizzly HTTP
      AprEndpoint$SocketProcessor.run
      1. org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)[tomcat-coyote.jar:7.0.47]
      2. org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)[tomcat-coyote.jar:7.0.47]
      3. org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2430)[tomcat-coyote.jar:7.0.47]
      4. org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2419)[tomcat-coyote.jar:7.0.47]
      4 frames
    11. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)[na:1.7.0_45]
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)[na:1.7.0_45]
      3. java.lang.Thread.run(Unknown Source)[na:1.7.0_45]
      3 frames