Hi, Arjen (or anyone else who thinks they might know the answer).
I'm looking at what apparently looks like a swallowed stack trace. I have log4j set to DEBUG level for Spring, and it's showing good data, except for this one, so I'm not sure if the swallow is in Spring or in SAAJ code, or ?
Anyway, here's the error shown in the tomcat log:
...but when I step through SoapMessageDispatcher(MessageDispatcher).dispatch( MessageContext) line: 260, I see this (essentially) in the Eclipse Debugger Variables tab:Code:Marshalling [javax.xml.bind.JAXBElement@916ab8] to response payload Testing endpoint exception resolver [org.springframework.ws.soap.endpoint.SoapFa ultMappingExceptionResolver@5866c1] Could not complete request java.lang.IllegalStateException: Response already created at org.springframework.ws.soap.context.AbstractSoapMessageContext.create SoapResponse(AbstractSoapMessageContext.java:51) at org.springframework.ws.soap.endpoint.SoapFaultMappingExceptionResolve r.resolveExceptionInternal(SoapFaultMappingExceptionResolver.java:75) at org.springframework.ws.endpoint.AbstractEndpointExceptionResolver.res olveException(AbstractEndpointExceptionResolver.java:61) at org.springframework.ws.MessageDispatcher.processEndpointException(Mes sageDispatcher.java:360) at org.springframework.ws.MessageDispatcher.dispatch(MessageDispatcher.j ava:261) at org.springframework.ws.MessageDispatcher.invoke(MessageDispatcher.jav a:209) at org.springframework.ws.transport.http.MessageHandlerAdapter.handle(Me ssageHandlerAdapter.java:57) at org.springframework.web.servlet.DispatcherServlet.doDispatch(Dispatch erServlet.java:723) at org.springframework.web.servlet.DispatcherServlet.doService(Dispatche rServlet.java:663) at org.springframework.web.servlet.FrameworkServlet.processRequest(Frame workServlet.java:394) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServ let.java:358) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV alve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV alve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j ava:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j ava:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal ve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav a:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java :869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.p rocessConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo int.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFol lowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP ool.java:684) at java.lang.Thread.run(Thread.java:595) Publishing event in context [WebApplicationContext for namespace 'utdEditorSprin gWS-servlet']: RequestHandledEvent: url=[/utdEditor/UtdEditor]; time=[113236ms]; client=[10.1.20.33]; method=[POST]; servlet=[utdEditorSpringWS]; session=[null] ; user=[null]; status=[failed: java.lang.IllegalStateException: Response already created] Publishing event in context [Root WebApplicationContext]: RequestHandledEvent: u rl=[/utdEditor/UtdEditor]; time=[113236ms]; client=[10.1.20.33]; method=[POST]; servlet=[utdEditorSpringWS]; session=[null]; user=[null]; status=[failed: java.l ang.IllegalStateException: Response already created]
As you can see, the REAL culprit is a SaxParseException, the useful details of which are being swallowed by something (SAAJ? SpringWS?).Code:SoapMessageDispatcher this= SoapMessageDispatcher (id=67) Exception ex= JaxbMarshallingFailureException (id=228) Throwable cause (Throwable)= JaxbMarshallingFailureException (id=228) Throwable cause (Throwable)= JaxbMarshallingFailureException (id=228) Throwable cause (NestedRuntimeException)= MarshalException (id=230) String detailMessage= "JAXB marshalling exception: null" StackTraceElement[] stackTrace= null Throwable cause (NestedRuntimeException)= MarshalException (id=230) Throwable cause= MarshalException (id=230) String detailMessage= null String errorCode= null Throwable linkedException= SAXParseException (id=233) Throwable cause= SAXParseException (id=233) int columnNumber= 0 [^@ (NUL)] String detailMessage= "cvc-complex-type.2.4.a: Invalid content was found starting with element 'Parms'. One of '{"http://www.mycompany.com":Msg}' is expected." Exception exception= null int lineNumber= 0 [^@ (NUL)] String publicId= null StackTraceElement[] stackTrace= null String systemId= null StackTraceElement[] stackTrace= null String detailMessage= "JAXB marshalling exception: null" StackTraceElement[] stackTrace= null MessageContext messageContext= SaajSoapMessageContext (id=226) EndpointInvocationChain mappedEndpoint= SoapEndpointInvocationChain (id=229) int interceptorIndex= 0 [^@ (NUL)]
Can we (you or I) get it to stop swallowing these vital error messages somehow. I mean, without such, how would we reasonably debug this kind of thing in production?
I will now state, to the current java world, a proposed philosophy on error handling in software. This is just my opinion, but is based on years and years of real-world financial/insurance app development. Most software managers, and my wife, who can barely use a computer, find it intuitively obvious as soon as I say it, and yet few of today's software systems actually implement it well, probably because (a) the state-of-the-art for meaningful error-handling/reporting is, after 50 or so years, still apparently in its infancy, and (b) the rest of the software is advancing so quickly on other fronts, that there is never a good incentive to build complete, robust error-handling systems:
"The symptom of an error should lead the user naturally and intuitively to a solution."
Addendum: "All software developers, even assembler programmers, are, at some level, 'users'."
Code that swallows errors obviously does not lead the user naturally and intuitively to a solution.
Again, I'm not picking on Spring. Just making a general statement about the state of java, and possibly all programming going on today, coz the problem keeps coming up over and over again in all the software I use...and, perhaps in the software I write as well
Ben



Reply With Quote