Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException: empty SOAP body and use of an interceptor [SWS-857] #927

Closed
gregturn opened this issue Jan 7, 2014 · 0 comments
Closed
Assignees
Milestone

Comments

@gregturn
Copy link
Member

@gregturn gregturn commented Jan 7, 2014

Martin Wegner opened SWS-857 and commented

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:

QName payloadRootName = PayloadRootUtils.getPayloadRootQName(request.getPayloadSource(), transformerHelper);
if (!namespaceUri.equals(payloadRootName.getNamespaceURI())) {

The variable payloadRootName is null if the SOAP body is empty.

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]

Affects: 2.1.4

Referenced from: commits b12a3e6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants