Friday, March 01, 2013

java.sql.SQLException: Io exception: The Network Adapter could not establish the connection


If you struggle with below  exception ,  check from my solution points.

Problem :

<BEA-001156> <Stack trace associated with message 001129 follows:
java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:3

Solution : 

1.Check the datasource parameters like db url and query to test the database is up or not.
2.check from the server machine the DB host is ping-able or not.
   If not add the defined db hostname and ip address to the hosts file in the server.
3.Check whether there is any N/W outage is there or not.
4.check DB is up and Running or not.
5.Check the servers N/w adapters are online and ready to accept and send requests.
  If you find problem restart the network adapter and check once again.
6.If all above does not solve the problem then restart the managed server and check.


Thanks,
Babu