1
I have a simple Java application that makes a JDBC connection in an Oracle database, follow the source.
public class Main {
public static void main(String[] args) {
try {
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@" + args[0] + ":1521/" + args[1], args[2],
args[3]);
if (conn != null) {
System.out.println("Connected to the database!");
} else {
System.out.println("Failed to make connection!");
}
conn.close();
System.out.println("Disconnected to the database!");
} catch (SQLException e) {
System.err.format("SQL State: %s\n%s \n", e.getSQLState(), e.getMessage());
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
}
When running the application on my machine, inform the parameters via arguments, it connects in the bank normally, this bank is in a cloud of Oracle that we have here in the company.
Now, I have exported this application to a JAR and I am trying to run it on a server on that server by calling the JAR by passing the same arguments at the time Drivermanager.getConnection() is run; an error is displayed after a few seconds, follow the error log below.
SQL State: 08006
Erro de ES: Conexão fechada pela outra ponta, Authentication lapse 0 ms.
java.sql.SQLRecoverableException: Erro de ES: Conexão fechada pela outra ponta, Authentication lapse 0 ms.
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:794)
at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:688)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:39)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:691)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at br.com.teste.oracle.Main.main(Main.java:11)
Caused by: java.io.IOException: Conexão fechada pela outra ponta, Authentication lapse 0 ms.
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:790)
... 6 more
Caused by: java.io.IOException: Conexão fechada pela outra ponta
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at sun.nio.ch.IOUtil.read(IOUtil.java:197)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
at oracle.net.nt.TimeoutSocketChannel.read(TimeoutSocketChannel.java:144)
at oracle.net.ns.NIOHeader.readHeaderBuffer(NIOHeader.java:82)
at oracle.net.ns.NIOPacket.readFromSocketChannel(NIOPacket.java:139)
at oracle.net.ns.NIOPacket.readFromSocketChannel(NIOPacket.java:101)
at oracle.net.ns.NIONSDataChannel.readDataFromSocketChannel(NIONSDataChannel.java:80)
at oracle.net.ano.CryptoNIONSDataChannel.readDataFromSocketChannel(Unknown Source)
at oracle.jdbc.driver.T4CMAREngineNIO.prepareForReading(T4CMAREngineNIO.java:98)
at oracle.jdbc.driver.T4CMAREngineNIO.unmarshalUB1(T4CMAREngineNIO.java:534)
at oracle.jdbc.driver.T4C8TTIdty.receive(T4C8TTIdty.java:728)
at oracle.jdbc.driver.T4C8TTIdty.doRPC(T4C8TTIdty.java:639)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1544)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:518)
... 6 more
It may be some infrared problem, but I have no idea what it might be, I made this Main class only to test, because it is giving this error in our real application, so I wanted to be sure of the problem and I made a basic class that only realizes the connection.
Due to the error, the database server is rejecting the connection, it may be blocking the application server IP?
– Costamilam
That’s what’s hard to figure out, because the bank’s control is outsourced here, so we’re trying to contact them so they can help us
– matheus.paulo93