osgi> log4j:ERROR Could not connect to remote log4j server at [localhost]. We will try again later.
javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: java.net.SocketException: Software caused connection abort: socket write error
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkEOF(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkWrite(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source)
at java.io.ObjectOutputStream$BlockDataOutputStream.drain(Unknown Source)
at java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(Unknown Source)
at java.io.ObjectOutputStream.writeNonProxyDesc(Unknown Source)
at java.io.ObjectOutputStream.writeClassDesc(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeFatalException(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at sexpert.server.impl.ParallelUtils.send(ParallelUtils.java:58)
at sexpert.server.impl.APeerServer.run(APeerServer.java:67)
Caused by: javax.net.ssl.SSLException: java.net.SocketException: Software caused connection abort: socket write error
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source)
at java.io.ObjectOutputStream$BlockDataOutputStream.drain(Unknown Source)
at java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at sexpert.server.fileTransfer.FileSender.sendFile(FileSender.java:69)
at sexpert.server.impl.SExpertServer.handleMessageGetFile(SDMExpertServer.java:80)
at sexpert.server.impl.SExpertServer.handleMessage(SDMExpertServer.java:336)
at sexpert.server.impl.APeerServer.run(APeerServer.java:64)
Caused by: java.net.SocketException: Software caused connection abort: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(Unknown Source)
at java.net.SocketOutputStream.write(Unknown Source)
at com.sun.net.ssl.internal.ssl.OutputRecord.writeBuffer(Unknown Source)
at com.sun.net.ssl.internal.ssl.OutputRecord.write(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecordInternal(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(Unknown Source)
... 9 more
The answers of http://stackoverflow.com/questions/2126607/official-reasons-for-software-caused-connection-abort-socket-write-error
(1) You don't say so, but assuming that you see this on Windows, this Sun forum posting gives a general answer to the cause of these problems.
Anything that externally interrupts your network access can cause Windows to return "software caused connection abort". It's the "General Protection Fault" of network errors ...
The posting then goes on to suggest that you look in the Windows event log for the possible cause. So, in response for your questions I would say
- The specific cause you hypothesize may or may not be correct. You'd need to do more research, starting with looking at the Windows Event Log.
- You have not looked at the relevant part of the JVM source yet. You need to look at the implementations of the native methods. The source code is available.
- There is no "official" Sun document that I can find that talks about this message. Try doing a search for the message using the site search on "java.sun.com".
- If you need an "official" Sun diagnosis, you will need to get an support contract.
- If you want real proof, you are out of luck. Problems as complicated as this are not amenable to proof using current theorem proving technology.
This is also caused when the connection was aborted instead of normally terminated.
(2) Not very well documented, but the call to Socket.close()
causes the connection to be aborted. This results in this Exception on the other connection side, instead of generating an EOF condition while reading.
To start a TCP's normal connection termination sequence, the client (and server) should callSocket.shutdownOutput()
, see the javadoc here. This causes the other side to get an EOF if reading from the Socket, which should also be followed by a call to shutdownOutput()
before closing
即正常关闭Socket是一段调用socket.shutdownOutput()再进行socket.close(),另一端就会受到一个EOF。而如果一端直接调用socket.close(),另外一段就可能抛出socket write error 异常。