java.sql.SQLRecoverableException: IO Error: Connection reset

I wrote an executable jar package to execute on Linux, connected to Oracle 11g database and obtained database data. It was always the card owner. When it timed out, it ran out with an error message. The server could be restarted several times, and it was stuck later.

Execute jar package statement

/root/jdk1.8.0_ 181/bin/java -jar GetJdbc-1.0-SNAPSHOT.jar

java.sql.SQLRecoverableException: IO Error: Connection reset
        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:421)
        at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:531)
        at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:221)
        at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503)
        at java.sql.DriverManager.getConnection(DriverManager.java:664)
        at java.sql.DriverManager.getConnection(DriverManager.java:247)
        at com.iwhalecloud.jdbc.utils.GetDataSource.getConnection(GetDataSource.java:27)
        at com.iwhalecloud.jdbc.execute.DistinguishDataSource.oracleQuery(DistinguishDataSource.java:78)
        at com.iwhalecloud.jdbc.execute.DistinguishDataSource.dataHandle(DistinguishDataSource.java:34)
        at com.iwhalecloud.jdbc.main.MainProgram.main(MainProgram.java:26)
Caused by: java.net.SocketException: Connection reset
        at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:115)
        at java.net.SocketOutputStream.write(SocketOutputStream.java:155)
        at oracle.net.ns.DataPacket.send(DataPacket.java:199)
        at oracle.net.ns.NetOutputStream.flush(NetOutputStream.java:211)
        at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:227)
        at oracle.net.ns.NetInputStream.read(NetInputStream.java:175)
        at oracle.net.ns.NetInputStream.read(NetInputStream.java:100)
        at oracle.net.ns.NetInputStream.read(NetInputStream.java:85)
        at oracle.jdbc.driver.T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputStreamWrapper.java:122)
        at oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:78)
        at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1179)
        at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1155)
        at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:279)
        at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
        at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:366)
        at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:752)
        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:359)
        ... 10 more
close
Exception in thread "main" java.lang.NullPointerException
        at com.iwhalecloud.jdbc.execute.DistinguishDataSource.oracleQuery(DistinguishDataSource.java:80)
        at com.iwhalecloud.jdbc.execute.DistinguishDataSource.dataHandle(DistinguishDataSource.java:34)
        at com.iwhalecloud.jdbc.main.MainProgram.main(MainProgram.java:26)

Find an effective solution on the Internet and add a parameter – DJava. Security. EGD = file:/dev /../dev/urandom

The execution statement is as follows

/root/jdk1.8.0_ 181/bin/java -jar -Djava.security.egd=file:/dev/../dev/urandom GetJdbc-1.0-SNAPSHOT.jar

Read More: