dawhisman
asked on
JDBC connectivity error between Java app and Oracle 10.2 database.
I am getting an error when running a small Java program in Red Hat 4 stating Oracle library does not exist (error provided below) when the Java app attempts to perform a JDBC connection to an Oracle database.
the error:
- Empty stack (returning null)
Exception in thread "main" java.lang.UnsatisfiedLinkE rror: /u01/app1/oracle/10gdb/lib 32/libocij dbc10.so: /u01/app1/oracle/10gdb/lib 32/libocij dbc10.so: cannot open shared object file: No such file or directory
This library DOES exist.
- Red Hat 4.0 x86_64
- Oracle database 10.2.0.2.0
- JRE 1.3 (Oracle delivered; embedded in software)
- JDK 5.0 (downloaded)
The "missing" library DOES exist so I suspect our problem is that we have a variable set wrong. The variables I am tweaiing (in my troubleshooting) are follows:
PATH
CLASSPATH
LD_LIBRARY_PATH
JAVA_HOME
Here is my KSH script I'm running:
export ORACLE_HOME=/u01/app1/orac le/10gdb
export BASE=/u01/app2/heritage_pr od
export JAVA_HOME=/u01/app1/jdk_1. 5.0/jdk1.5 .0_05
export ANT_HOME=/u01/app1/apache- ant-1.7.0
export LD_LIBRARY_PATH=$LD_LIBRAR Y_PATH:/u0 1/app1/ora cle/10gdb/ lib32/libo cijdbc10.s o
export PATH=$ANT_HOME/bin:$JAVA_H OME/bin:$P ATH:$LD_LI BRARY_PATH
export CLASSPATH=/u01/app1/stage/ jdbc/class es12.jar:/ u01/app1/o racle/10gd b/lib32:.
cd $BASE
ant -debug -logfile $BASE/run_ant_log.txt -f $BASE/run.xml run_corporate_insert
Does anyone see anything wrong with how these variables are set?
If settings look right: What other reasons might cause this error to occur?
the error:
- Empty stack (returning null)
Exception in thread "main" java.lang.UnsatisfiedLinkE
This library DOES exist.
- Red Hat 4.0 x86_64
- Oracle database 10.2.0.2.0
- JRE 1.3 (Oracle delivered; embedded in software)
- JDK 5.0 (downloaded)
The "missing" library DOES exist so I suspect our problem is that we have a variable set wrong. The variables I am tweaiing (in my troubleshooting) are follows:
PATH
CLASSPATH
LD_LIBRARY_PATH
JAVA_HOME
Here is my KSH script I'm running:
export ORACLE_HOME=/u01/app1/orac
export BASE=/u01/app2/heritage_pr
export JAVA_HOME=/u01/app1/jdk_1.
export ANT_HOME=/u01/app1/apache-
export LD_LIBRARY_PATH=$LD_LIBRAR
export PATH=$ANT_HOME/bin:$JAVA_H
export CLASSPATH=/u01/app1/stage/
cd $BASE
ant -debug -logfile $BASE/run_ant_log.txt -f $BASE/run.xml run_corporate_insert
Does anyone see anything wrong with how these variables are set?
If settings look right: What other reasons might cause this error to occur?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ajay_Singh,
While your suggestion was not exactly correct it did make me realize my mistake upon further reflection: I had my library getting set to the 32-bit libraries while I'm running 64-bit Linux. I shifted around the LD_LIBRARY_PATH sequence (so /lib is used first instead of /lib32) and voila! Problem fixed.
Since you are the only one who responded and since you mostly had the correct answer I will award you the points. Thanks!
While your suggestion was not exactly correct it did make me realize my mistake upon further reflection: I had my library getting set to the 32-bit libraries while I'm running 64-bit Linux. I shifted around the LD_LIBRARY_PATH sequence (so /lib is used first instead of /lib32) and voila! Problem fixed.
Since you are the only one who responded and since you mostly had the correct answer I will award you the points. Thanks!
ASKER