troubleshooting Question

JDBC connectivity error between Java app and Oracle 10.2 database.

Avatar of dawhisman
dawhisman asked on
Oracle DatabaseJavaLinux Distributions
3 Comments1 Solution1211 ViewsLast Modified:
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.UnsatisfiedLinkError: /u01/app1/oracle/10gdb/lib32/libocijdbc10.so: /u01/app1/oracle/10gdb/lib32/libocijdbc10.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/oracle/10gdb
export BASE=/u01/app2/heritage_prod
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_LIBRARY_PATH:/u01/app1/oracle/10gdb/lib32/libocijdbc10.so
export PATH=$ANT_HOME/bin:$JAVA_HOME/bin:$PATH:$LD_LIBRARY_PATH
export CLASSPATH=/u01/app1/stage/jdbc/classes12.jar:/u01/app1/oracle/10gdb/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?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros