Question. Will it hurt to have two different odbc jar files in the lib folder?

I've been connecting to a production server on Oracle10g for some time, and 
have had my context.xml file in the META-INF directory of one web app 
configured to hit this Oracle server.

Our group just got a new development server on Oracle11g, and while I can 
connect to it via Toad or SQL Plus (thereby assuring the tnsnames file is 
properly configured) I cannot connect at all from the web app in Tomcat.

I've been using the drivers in the ojdbc14_g.jar file for some time but I think 
I may need ojdbc6.jar for the new Oracle server. I wasn't sure if these two 
would conflict or not.

FWIW, I'm using:
Tomcat Version 6.0.26
JDK 1.6.0_18
Win XP is my OS for the test machine.

The above mentioned .jar files. I just added the second one, ojdbc6.jar, then 
deleted the work folder contents and restarted the web app.

My context.xml file is configured in the following manner:

----------
<Context>
  <Resource
    auth="Container"
    description="changectrlappdev"
    name="jdbc/myoracledev"
    type="javax.sql.DataSource"
    driverClassName="oracle.jdbc.driver.OracleDriver"
    username="usernm"
    password="password"
    url="jdbc:oracle:thin:@croesm6734:2504:LANDMVJ"
    maxIdle="30"
    maxWait="10000"
    maxActive="10"
    testOnBorrow="true"
    timeBetweenEvictionRunsMillis="-1"
    minEvictableIdleTimeMillis="28800"
    poolPreparedStatements="true"
    removeAbandoned="true"
    removeAbandonedTimeout="300"
    logAbandoned="false"/>


    <Realm className="org.apache.catalina.realm.DataSourceRealm"
    localDataSource="true"
       dataSourceName="jdbc/myoracledev"
       userTable="users" userNameCol="user_name" userCredCol="user_pass"
   userRoleTable="user_roles" roleNameCol="role_name"/>    <!--using -->

</Context>
------------
I've also tried the following:
----------
<Context>
  <Resource
    auth="Container"
    description="changectrlappdev"
    name="jdbc/myoracledev"
    type="javax.sql.DataSource"
    driverClassName="oracle.jdbc.driver.OracleDriver"
    username="usernm"
    password="password"
    url="jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC )(KEY = LANDMVJ))
    (ADDRESS = (PROTOCOL = TCP )(HOST = croesm6734.specserver.net)(PORT = 
2504)))
   (CONNECT_DATA =  (SID = OPSDEV)  (SERVICE_NAME = LANDMVJ)"
    maxIdle="30"
    maxWait="10000"
    maxActive="10"
    testOnBorrow="true"
    timeBetweenEvictionRunsMillis="-1"
    minEvictableIdleTimeMillis="28800"
    poolPreparedStatements="true"
    removeAbandoned="true"
    removeAbandonedTimeout="300"
    logAbandoned="false"/>

    <Realm className="org.apache.catalina.realm.DataSourceRealm"
    localDataSource="true"
       dataSourceName="jdbc/myoracledev"
       userTable="users" userNameCol="user_name" userCredCol="user_pass"
   userRoleTable="user_roles" roleNameCol="role_name"/>

</Context>
--------------------------
with the same error message getting logged.

SEVERE: Servlet.service() for servlet jsp threw exception
java.sql.SQLException: Io exception: Connection 
refused(DESCRIPTION=(TMP=)(VSNNUM=185599744)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))
        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)


I feel this is mostly a driver error, but related to Tomcat in terms of the way 
the jar files are housed in the lib directory and perhaps if one set of driver 
classes takes precedent over another?

I really wasn't sure if those two jar files would conflict and cause issues.

If anyone can enlighten me on this it would be appreciated!

Thanks,

Barry

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to