I have an application that connects to an Oracle database that works fine in development on any development machine I can find but falls over with the following error when being ran from a production or test server environment:
java.sql.SQLException: Io exception: The Network Adapter could not establish the connection at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:334) at oracle.jdbc.ttc7.TTC7Protocol.handleIOException(TTC7Protocol.java:3668) at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:353) at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:371) at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:551) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:351) at java.sql.DriverManager.getConnection(DriverManager.java:571) at java.sql.DriverManager.getConnection(DriverManager.java:215) ....
Network configuration is always a little sketchier from test and production environments here compared to development machines so my first assumption was that firewalls haven't been properly configured but I've checked those and just to be sure I tried telnetting from the affected machines to the Oracle servers on the necessary port and that works fine:
[root@CLIENT ~]# telnet [Oracle Host IP] 1521 Trying [Oracle Host IP]... Connected to [Oracle Host IP]. Escape character is '^]'. ^C Connection closed by foreign host.
Is there anything else I can be missing here? Or at least any other suggestions for debugging this issue?
I figured if I can ping from the affected machine to the target Oracle server and even telnet on the port then they should be able to communicate but not sure if there's something Oracle specific that I'm missing here.