Connection Pool Failure

Could not create Connection Pool

This kind of issues are common for Weblogic admins, you need to tackle with wise tricks. While configuring for a fresh WebLogic domain you might encounter this issue, While giving the connection pool parameters, It will show the following error in the WebLogic Server logs: <Warning> <JDBC> <BEA-001129> <Received exception while creating connection for pool "myds1": ORA-00257: archiver error. Connect internal only, until freed.>  <Error> <Deployer> <BEA-149205> <Failed to initialize the application 'myds1' due to error weblogic.application.ModuleException: .weblogic.application.ModuleException:         at weblogic.jdbc.module.JDBCModule.prepare(JDBCModule.java:290)

        at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)

        at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:507)

        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)

        at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:149)

        Truncated. see log file for complete stacktrace

Caused By: weblogic.common.ResourceException: weblogic.common.ResourceException: Could not create pool connection. The DBMS driver exception was: ORA-00257: archiver error. Connect internal only, until freed.

        at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(ConnectionEnvFactory.java:263)

        at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1193)

        at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1117)

        at weblogic.common.resourcepool.ResourcePoolImpl.start(ResourcePoolImpl.java:244)

        at weblogic.jdbc.common.internal.ConnectionPool.doStart(ConnectionPool.java:1109)

        Truncated. see log file for complete stacktrace

Trouble shooting 

You might wonder such scenario don't be panic when you got such Warning/Error, Relax, You have alternative way of testing your Oracle Database connectivity from the WebLogic installation machine. Remember that Oracle Thin Driver does not refer the 'tnsnames.ora' file. If your WebLogic machine may not have Oracle client connectivity even thought you can identify the connectivity to the database, It is a powerful command line utility, that gives you the connection details. You could do this drill before trying to configuring your DataSource with a Database details that must go for a Connection pool parameters. Some times this might be interview question for WebLogic Admins " How do you know the given database parameters are suitable for configuring a connection pool or not?"

The simple way answering this question is using command line utility provided by Oracle WebLogic "dbping".

The dbping command Usage

java utils.dbping DB2B  [-d dynamicSections] USER PASS HOST:PORT/DBNAME

or     java utils.dbping DERBY        USER PASS HOST:PORT/DBNAME

or     java utils.dbping JCONN2       USER PASS HOST:PORT/DBNAME

or     java utils.dbping JCONN3       USER PASS HOST:PORT/DBNAME

or     java utils.dbping JCONNECT     USER PASS HOST:PORT/DBNAME

or     java utils.dbping INFORMIXB    USER PASS HOST:PORT/DBNAME/INFORMIXSERVER

or     java utils.dbping MSSQLSERVERB USER PASS HOST:PORT/[DBNAME]

or     java utils.dbping MYSQL        USER PASS [HOST][:PORT]/[DBNAME]

or     java utils.dbping ORACLEB      USER PASS HOST:PORT/DBNAME

or     java utils.dbping ORACLE_THIN  USER PASS HOST:PORT:DBNAME

or     java utils.dbping POINTBASE    USER PASS HOST[:PORT]/DBNAME

or     java utils.dbping SYBASEB      USER PASS HOST:PORT/DBNAME

Let me give you sample run with a wrong password see the output for the dbping utility.

This utility requires dbuser, dbpassword, dbhostname:dbport:dbschema as parameters. If you pass any one of them wrong it won't be connecting to the database server. It will gives you error stack trace.

$  java utils.dbping ORACLE_THIN scott tgier mydb.server.company.com:1526:dbschema

 

Error encountered:

 

java.sql.SQLException: Listener refused the connection with the following error:

ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

 

        at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)

        at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)

        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:199)

        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:480)

        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:413)

        at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:508)

        at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:203)

        at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33)

        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:510)

        at java.sql.DriverManager.getConnection(DriverManager.java:582)

        at java.sql.DriverManager.getConnection(DriverManager.java:154)

        at utils.dbping.main(dbping.java:200)

Caused by: oracle.net.ns.NetException: Listener refused the connection with the following error:

ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

 

        at oracle.net.ns.NSProtocol.connect(NSProtocol.java:363)

        at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:966)

        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:292)

Now let me give the correct password see how it responds

$ java utils.dbping ORACLE_THIN scott tiger mydb.server.company.com:1526:dbschema

 

**** Success!!! ****

 

You can connect to the database in your app using:

 

  java.util.Properties props = new java.util.Properties();

  props.put("user", "scott");

  props.put("password", "tiger");

  java.sql.Driver d =

    Class.forName("oracle.jdbc.OracleDriver").newInstance();

  java.sql.Connection conn =

    Driver.connect("jdbc:oracle:thin:@mydb.server.company.com:1526:dbschema", props);

Now you reached to decide what are the correct parameters that could make a connection, when you configure your connection pool in your WebLogic console DataSource configuration section.

Confirmation

Administrator always be confident with double confirming the things are in the right position. Once you configure your datasource on your WebLogic console. You have option to test the connection, use it for testing. When application is running the connection pool might establish connections with the database that you can confirm with simple network command, that should give you ESTABLISHED state.

$ netstat -anP tcp | grep 1526

Please don't forget to write your comments on this page. Your suggestions/comments are more than any appreciations.

References:

1. http://www.dba-oracle.com/sf_ora_00257_archiver_error_connect_internal_only_until_freed.htm