|
Problem |
There is a problem with the coexistence of DB2 with
Oracle, due to class conflict with the Oracle and DB2 native libraries,
the IBM® WebSphere® Appserver would crash when making a call to DB2
database, This problem is mostly seen on Linux® platforms. |
|
Cause |
If you look at the native stack of the current thread in
the javacore, resulting from the Appserver crash, you will notice that
"libdb2.so.1" library (which is part of DB2) is getting loaded when making
an Oracle JDBC call.
Please verify the following in the javacore, to confirm if you are
running into the same issue.
1. Current Thread Details
"Thread-0" (TID:0x404B3F10, sys_thread_t:0x822BEC0, state:R, native
oracle.jdbc.oci8.OCIDBAccess.do_open(Native Method)
oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:496)
oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(Orac
com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl.createManagedConn
com.ibm.ejs.j2c.poolmanager.FreePool.createManagedConnectionWithMCWrapper
Native Stack of ""Thread-0"" PID 16490
?? at 40017447 in libxhpi.so
Diagnostics_Impl at 4001753A in libxhpi.so
dgGenerateJavacore at 40265E88 in libjvm.so
ExceptionHandlerStub at 402CA516 in libjvm.so
A_SHAFinalCommon at AEF3719F in libdb2.so.1
A_X931RandomUpdate at B0C7B63C in libclntsh.so.9.0
OCISessionBegin at B0ACC41C in libclntsh.so.9.0
eoj_dbaccess_do_open at AE450BD8 in libocijdbc9.so
Java_oracle_jdbc_oci8_OCIDBAccess_do_1open at AE45753C
2. Check the LD_LIBRARY_PATH and classpath variables to see if libraries
from both Oracle and DB2 are listed
CLASSPATH=/u00/oracle/product/9.2.0/jdbc/lib/ojdbc14.jar:/u00/oracle/pro
duct/9.2.0/jdbc/lib/classes12.zip:/u00/oracle/product/9.2.0/jdbc/lib/ojd
bc14.jar:/u00/oracle/product/9.2.0/jdbc/lib/classes12.zip:/home/db2inst1
/sqllib/java/db2java.zip:/home/db2inst1/sqllib/java/db2jcc.jar:/home/db2
inst1/sqllib/java/db2jcc_license_cu.jar:.
Oracle client has been loaded from the Oracle driver. However, as can be
seen the /opt/IBMdb2/V7.1/lib/libdb2.sl file has been loaded by the Oracle
client, which is incorrect (the Oracle client attempted to load DB2)
|
|
Solution |
There are 3 possible solutions:
1. Switch to Type 4 JDBC driver for DB2 data source
2. Switch to Type 4 Oracle JDBC driver for the Oracle data source
3. Oracle client library needs to be rebuilt with the "-Bsymbolic" link
option.
Suggested work around
Oracle 10g :
1) back up $ORAC$$LE_HOME/bin/genclntsh,
$ORAC$$LE_HOME/lib/libclntsh.so.10.1,
$ORAC$$LE_HOME/lib32/libclntsh.so.10.1
2) cd $ORAC$$LE_HOME/lib; mv libnnz10.so libnnz10.so.orig (so
libnnz10.so not exist in lib)
3) cd $ORAC$$LE_HOME/bin; modify the script genclntsh:
a). Add " -Wl, -Bsymbolic " to linker line.... make sure there is no
spaces between the comma and -B.
ex. LD= " gcc -shared -Wl, -relax -L$ { ORACLE_HOME } /lib -Wl,
-Bsymbolic " # shared library link command
b) Change libnnz10.so ==> libnnz10.a in following line
* -r $ { OLIB } /libnnz10.so * && LNZ= " -lnnz10
Oracle 9i :
1) Back up your $ORAC$$LE_HOME/lib/libclntsh.so and
$ORAC$$LE_HOME/bin/genclntsh
2) Add '-Wl, -Bsymbolic' to the link line of
$ORAC$$LE_HOME/bin/genclntsh:
LD= " gcc -shared -Wl, -relax -L$ { ORACLE_HOME } /lib -Wl, -Bsymbolic "
# shared library link command
3) Run genclntsh to create libclntsh.so
4) Execute djxlinkOracle
5) Stop and Start the instance
|
|
|
|
Cross Reference information |
Segment |
Product |
Component |
Platform |
Version |
Edition |
Application Servers |
Runtimes for Java Technology |
Java SDK |
|
|
|
|
|
|
|