cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Royal <pro...@managingpartners.com>
Subject Handling java.net.SocketException's
Date Thu, 20 Dec 2001 17:11:31 GMT
(If this has been addressed/fixed in HEAD, please let me know. I'm still 
tracking the 2.0 branch here until I see some messages tossed about saying 
that all the experimental stuff has been moved to scratchpad. I know that's 
soon :)

In building upon Nicola's Notificable work here, I'm testing some components 
that send me an email for all exceptions that pass through the 
map:handle-errors pipeline.

For the CachingStreamPipeline.processReader(), java.net.SocketException's are 
examined to see if the message contains "reset" and if so re-thrown as a 
ConnectionResetException.

I'd like to implement similar behavior for all of the other pipeline's. 
Problem is, it appears that it will be difficult to get at the underlying 
exception in all cases.

For example, Xalan catches all exceptions and stuffs the message into a 
RuntimeException. Thus is would be futile to just catch SocketException's in 
the C2 code. (I've included a sample stacktrace at the bottom of the message)

I'm thinking that the only real solution (since I'm guessing that modifying 
the Xalan code isn't that much of an option. Aside from the fact that the 
run() method below is from the Java interface Runnable and i'm pretty sure 
you can't throw extra exceptions in an implemented interface) would be to 
catch RuntimeException's in Cocoon and examine the message to see if it 
contains 'java.net.SocketException' and 'reset', and if so re-throw as a 
ConnectionResetException.

I just wanted to get a feel from the group to see if this would be the 
recommended way to go before sending a patch. Thanks :)
-peter


Original exception : java.lang.RuntimeException: java.net.SocketException:
Connection reset by peer: socket write error
        at
org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3174)
        at
org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerH
andlerImpl.java:433)
        at
org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:48)
        at
org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:48)
        at
org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:48)
        at
org.apache.cocoon.components.sax.XMLByteStreamInterpreter.parse(XMLByteStrea
mInterpreter.java:69)
        at
org.apache.cocoon.components.sax.XMLByteStreamInterpreter.deserialize(XMLByt
eStreamInterpreter.java:59)
        at
org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEv
entPipeline.java:178)
        at
org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingS
treamPipeline.java:359)
        at
org.apache.cocoon.www.sitemap_xmap.wildcardMatchN40022A(sitemap_xmap.java:41
91)
        at org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java:1878)
        at org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java:1773)
        at org.apache.cocoon.sitemap.Handler.process(Handler.java:163)
        at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:114)
        at org.apache.cocoon.Cocoon.process(Cocoon.java:514)
        at 
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:650)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at 
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
        at org.apache.tomcat.core.Handler.service(Handler.java:286)
        at 
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
        at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
        at 
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
        at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:210)
        at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
        at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
        at java.lang.Thread.run(Thread.java:484)
-- 
peter royal -> proyal@managingpartners.com

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message