RMI error (SocketException: socket write error) on Tomcat 4.0, NT4/Win2K
Hi, -- Environment -- I am running Tomcat 4.0.1 on NT4 with JDK1.3.0. -- Error Symptom -- I have a servlet that makes RMI calls to an RMI server process (non EJB) on the same machine. It used to work fine on Tomcat 3.2.3 and Tomcat 3.3 but when we switched to Tomcat 4.0 it stopped working. The servlet looks-up the RMI server object successfully but fails as soon as it tries to invoke an RMI method with this exception: java.net.SocketException: Connection aborted by peer: socket write error [See end of message for full stack trace] At first we suspected it had to do with the policy file but we have ruled that out because we are NOT running with the -security option and the error doesn't seem to point to a security or permission problem. It also doesn't seem like a CLASSPATH problem because everything else (including the RMI lookup) works fine. I have scoured the web for a solution but found only an identical question on comp.lang.java with no reply. Is Tomcat 4.0 doing anything different with RMI? Is JNDI or EJB somehow involved here by default? We don't use either of these. Any help would be much appreciated! cheehan -- Stack Trace -- java.rmi.MarshalException: error marshalling arguments; nested exception is: java.net.SocketException: Connection aborted by peer: socket write error java.net.SocketException: Connection aborted by peer: socket write error at java.net.SocketOutputStream.socketWrite(Native Method) at java.net.SocketOutputStream.write(SocketOutputStream.java:83) at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:72 ) at java.io.BufferedOutputStream.write(BufferedOutputStream.java:116) at java.io.ObjectOutputStream.drain(ObjectOutputStream.java:1477) at java.io.ObjectOutputStream.setBlockData(ObjectOutputStream.java:1500) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:407) at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:268) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:106) at hello.ExecuterImpl_Stub.execute(Unknown Source) [...] at hello.ServletA.doPost(Unknown Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV alve.java:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline .java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV alve.java:201) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline .java:566) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve .java:246) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline .java:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java: 2344) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j ava:164) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline .java:566) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche rValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline .java:564) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j ava:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline .java:564) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java: 462) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline .java:564) at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterVa lve.java:324) at org.apache.catalina.valves.RemoteHostValve.invoke(RemoteHostValve.jav a:131) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline .java:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal ve.java:163) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline .java:566)
Re: RMI error (SocketException: socket write error) on Tomcat 4.0, NT4/Win2K
Turn on logging on the RMI server process: java -Djava.rmi.server.logCalls=true -Djava.rmi.server.logLevel=VERBOSE -Djava.rmi.loader.logLevel=VERBOSE ServerName where, java.rmi.server.logCalls=true - will log all incoming calls and exceptions java.rmi.server.logLevel=VERBOSE - will log details of outgoing calls java.rmi.loader.logLevel=VERBOSE - logs classname and codebase whenever RMI attempts to load a class as aresult of unmarshalling an arg. This could help in debugging. Thanks. RS. Tee Chee Han [EMAIL PROTECTED] on 12/19/2001 04:47:18 AM Please respond to Tomcat Users List [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc: Subject: RMI error (SocketException: socket write error) on Tomcat 4.0, NT4/Win2K Hi, -- Environment -- I am running Tomcat 4.0.1 on NT4 with JDK1.3.0. -- Error Symptom -- I have a servlet that makes RMI calls to an RMI server process (non EJB) on the same machine. It used to work fine on Tomcat 3.2.3 and Tomcat 3.3 but when we switched to Tomcat 4.0 it stopped working. The servlet looks-up the RMI server object successfully but fails as soon as it tries to invoke an RMI method with this exception: java.net.SocketException: Connection aborted by peer: socket write error [See end of message for full stack trace] At first we suspected it had to do with the policy file but we have ruled that out because we are NOT running with the -security option and the error doesn't seem to point to a security or permission problem. It also doesn't seem like a CLASSPATH problem because everything else (including the RMI lookup) works fine. I have scoured the web for a solution but found only an identical question on comp.lang.java with no reply. Is Tomcat 4.0 doing anything different with RMI? Is JNDI or EJB somehow involved here by default? We don't use either of these. Any help would be much appreciated! cheehan -- Stack Trace -- java.rmi.MarshalException: error marshalling arguments; nested exception is: java.net.SocketException: Connection aborted by peer: socket write error java.net.SocketException: Connection aborted by peer: socket write error at java.net.SocketOutputStream.socketWrite(Native Method) at java.net.SocketOutputStream.write(SocketOutputStream.java:83) at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:72 ) at java.io.BufferedOutputStream.write(BufferedOutputStream.java:116) at java.io.ObjectOutputStream.drain(ObjectOutputStream.java:1477) at java.io.ObjectOutputStream.setBlockData(ObjectOutputStream.java:1500) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:407) at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:268) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:106) at hello.ExecuterImpl_Stub.execute(Unknown Source) [...] at hello.ServletA.doPost(Unknown Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV alve.java:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline .java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV alve.java:201) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline .java:566) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve .java:246) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline .java:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java: 2344) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j ava:164) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline .java:566) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche rValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline .java:564) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j ava:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline .java:564) at org.apache.catalina.valves.AccessLogValve.invoke
Re: RMI error (SocketException: socket write error) on Tomcat 4.0, NT4/Win2K
I have found the solution. It turns out that RMI fails if Tomcat is installed in directory with white spaces. Before my original posting, I had actually seen this bug in the tomcat-dev mailing list: http://www.mail-archive.com/tomcat-dev%40jakarta.apache.org/msg17201.html But I thought my problem was a different one because the error mentioned in this bug report was one of MalformedURL. Out of desperation, I tried re-installing Tomcat in a directory without white space and now it works. In any case, thanks RS. cheehan [EMAIL PROTECTED] wrote: Turn on logging on the RMI server process: java -Djava.rmi.server.logCalls=true -Djava.rmi.server.logLevel=VERBOSE -Djava.rmi.loader.logLevel=VERBOSE ServerName where, java.rmi.server.logCalls=true - will log all incoming calls and exceptions java.rmi.server.logLevel=VERBOSE - will log details of outgoing calls java.rmi.loader.logLevel=VERBOSE - logs classname and codebase whenever RMI attempts to load a class as aresult of unmarshalling an arg. This could help in debugging. Thanks. RS. Tee Chee Han [EMAIL PROTECTED] on 12/19/2001 04:47:18 AM Please respond to Tomcat Users List [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc: Subject: RMI error (SocketException: socket write error) on Tomcat 4.0, NT4/Win2K Hi, -- Environment -- I am running Tomcat 4.0.1 on NT4 with JDK1.3.0. -- Error Symptom -- I have a servlet that makes RMI calls to an RMI server process (non EJB) on the same machine. It used to work fine on Tomcat 3.2.3 and Tomcat 3.3 but when we switched to Tomcat 4.0 it stopped working. The servlet looks-up the RMI server object successfully but fails as soon as it tries to invoke an RMI method with this exception: java.net.SocketException: Connection aborted by peer: socket write error [See end of message for full stack trace] At first we suspected it had to do with the policy file but we have ruled that out because we are NOT running with the -security option and the error doesn't seem to point to a security or permission problem. It also doesn't seem like a CLASSPATH problem because everything else (including the RMI lookup) works fine. I have scoured the web for a solution but found only an identical question on comp.lang.java with no reply. Is Tomcat 4.0 doing anything different with RMI? Is JNDI or EJB somehow involved here by default? We don't use either of these. Any help would be much appreciated! cheehan -- Stack Trace -- java.rmi.MarshalException: error marshalling arguments; nested exception is: java.net.SocketException: Connection aborted by peer: socket write error java.net.SocketException: Connection aborted by peer: socket write error at java.net.SocketOutputStream.socketWrite(Native Method) at java.net.SocketOutputStream.write(SocketOutputStream.java:83) at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:72 ) at java.io.BufferedOutputStream.write(BufferedOutputStream.java:116) at java.io.ObjectOutputStream.drain(ObjectOutputStream.java:1477) at java.io.ObjectOutputStream.setBlockData(ObjectOutputStream.java:1500) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:407) at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:268) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:106) at hello.ExecuterImpl_Stub.execute(Unknown Source) [...] at hello.ServletA.doPost(Unknown Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV alve.java:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline .java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV alve.java:201) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline .java:566) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve .java:246) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline .java:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943