You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by St...@avinci.de on 2003/03/10 18:48:25 UTC
xsltc: How to find out java.net.SocketException as reason of TransformerException ?
Hi,
i changed my transformations in a web-application from Xalan to XSLTC, but since some transformations only work with Xalan (because of bad stylesheets) i have a "mixed mode".
The Transformers are serializing directly to ServletOutputStreams.
In an older (Xalan-only) version, the TransformerException wrapped a java.net.SocketException
if the user had closed the browser during serialisation.
I 've been able to check it with .getCause() and ignored it because it's not really an Error.
Now, if Xalan is transforming, it somehow wraps to a java.lang.RuntimeException (which holds the SocketException only in its stacktrace) and i can't figure out if it's just because the Browser was closed (can't get nested Exception) - so i throw it (wrapped into my own "ViewProcessingException").
If XSLTC is transforming, a org.apache.xml.utils.WrappedRuntimeException is thrown and i can find the
SocketException and everything is fine.
In the case of Xalan I think i can't ignore those RuntimeExceptions (wrapped by TransformerExceptions) too, because they may have other reasons and i don't want to seek inside the message / stacktrace for the
"Connection reset by peer: socket write error" pattern.
Does someone has an idea what to do ?
Will it be changed to a WrappedRuntimeException or a nested SocketException later ?
Do i have a bad mix of jars ?
Stefan
I use Xalan 2.4.1, IBM Websphere and this is the stacktrace:
ERROR: 'java.net.SocketException: Connection reset by peer: socket write error'
Wrapping exception number 1:
com.kpmg.de.wfo.framework.mvc.view.ViewProcessingException
at com.kpmg.de.wfo.framework.xml.serializers.TraxSerializer.serialize(TraxSerializer.java:148)
at com.kpmg.de.wfo.framework.xml.XMLViewProcessor.processView(XMLViewProcessor.java:220)
at com.kpmg.de.wfo.framework.mvc.view.ViewPresenter.presentView(ViewPresenter.java:53)
at com.kpmg.de.wfo.framework.mvc.controller.web.Main.presentView(Main.java:505)
at com.kpmg.de.wfo.framework.mvc.controller.web.Main.performTask(Main.java(Compiled Code))
at com.kpmg.de.wfo.framework.mvc.controller.web.Main.doGet(Main.java:133)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:827)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:159)
at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:286)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:106)
at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:472)
at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:1012)
at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:913)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:499)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:278)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:105)
at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:67)
at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:123)
at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:67)
at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:106)
at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:125)
at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:315)
at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.java:60)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:313)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:242)
at com.ibm.ws.util.CachedThread.run(ThreadPool.java:122)
javax.xml.transform.TransformerException: java.lang.RuntimeException: java.net.SocketException: Connection reset by peer: socket write error
at org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:644)
at org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:256)