Discussions

EJB programming & troubleshooting: Excpetion while creating connection pool in Weblogic

  1. Hi ,

    I am trying create connection pools from oracle 8i database. I have set the necessary path in startweblogic.properties. But I am getting the following excpetion when I start my weblogic app server.

    java.sql.SQLException: The Network Adapter could not establish the connection
            at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:407)
            at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:152)
            at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:214)
            at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:193)
            at weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(ConnectionEnvFactory.
            at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(ConnectionEnvFactory.
            at weblogic.common.internal.ResourceAllocator.makeResources(ResourceAllocator.java, Compil
            at weblogic.common.internal.ResourceAllocator.<init>(ResourceAllocator.java, Compiled Code
            at weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.java:330)
            at weblogic.jdbc.common.internal.JdbcInfo.initPools(JdbcInfo.java, Compiled Code)
            at weblogic.jdbc.common.internal.JdbcInfo.startup(JdbcInfo.java:200)
            at weblogic.jdbc.common.internal.JdbcStartup.main(JdbcStartup.java:11)
            at java.lang.reflect.Method.invoke(Native Method)
            at weblogic.t3.srvr.StartupThread.runMain(StartupThread.java:219)
            at weblogic.t3.srvr.StartupThread.doWork(StartupThread.java, Compiled Code)
            at weblogic.t3.srvr.PropertyExecuteThread.run(PropertyExecuteThread.java:62)
    Tue Mar 27 18:29:02 GMT+05:30 2001:<I> <JDBC Pool> Sleeping in createResource()
    Tue Mar 27 18:29:03 GMT+05:30 2001:<E> <JDBC Pool> Failed to create connection pool "tpPool"
    weblogic.common.ResourceException: weblogic.common.ResourceException:
    Could not create pool connection. The DBMS driver exception was:
    java.sql.SQLException: The Network Adapter could not establish the connection ....

    Kindly get the feedback.

    Shiva
  2. Hi,
    I'm assuming that u r using weblogic 5.1 & oracle 8.1.5 client with oracle 8i server.
    <br>
    First, weblogic requires oracle client to be installed on the server machine. So install oracle client on the weblogic server machine.
    <br>
    Second, go thru admin manual of weblogic. On NT machine, u need to update PATH variable on the weblogic server machine.
    <br>
    This should solve ur prob.
  3. hi,
        as the earlier reply, one error could be the oracle client is not installed, other could be the server name is such that it is not able to resolve the server name. just check the database client connection from your client side, with sqlplus or other tools. other reason could be the listener in the oracle server is not started.
  4. You should be able to use both type 2 and type 4 JDBC drivers for connection pool.

    Here is my setting in weblogic.properties (5.1 sp8) / Oracle 8.1.6 EE. You got to make sure that your oracle listener is running.

    For thin driver supplied by oracle:(Follow the instructions from Oracle for setting classpath).

    weblogic.jdbc.connectionPool.demoPool=\
        url=jdbc:oracle:thin:scott/tiger@localhost:1521:BANKDB,\
           driver=oracle.jdbc.driver.OracleDriver,\
           loginDelaySecs=1,\
           initialCapacity=4,\
           maxCapacity=10,\
           capacityIncrement=2,\
           allowShrinking=true,\
           shrinkPeriodMins=15,\
           refreshMinutes=10,\
           testTable=dual,\
           props=user=SCOTT;password=tiger

    For using the type2 driver supplied with Weblogic,

    weblogic.jdbc.connectionPool.demoPool=\
           url=jdbc20:weblogic:oracle,\
           driver=weblogic.jdbc20.oci.Driver,\
           loginDelaySecs=1,\
           initialCapacity=4,\
           maxCapacity=10,\
           capacityIncrement=2,\
           allowShrinking=true,\
           shrinkPeriodMins=15,\
           refreshMinutes=10,\
           testTable=dual,\
           props=user=SCOTT;password=tiger;server=BANKDB


    Hope this helps..

    Regards
    Murali