Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

no ocijdbc10 in java.library.path

So I've been plagued by this issue, whenever I try to run my app in eclipse, I get this error.

2011-02-23 09:55:08,388 ERROR (com.xxxxx.services.factory.ServiceInvokerLocal:21) - 
java.lang.UnsatisfiedLinkError: no ocijdbc10 in java.library.path

I've tried following the steps I found here with no luck. I've tried this on a XP VM as well as windows 7 (although in win 7 I get a different error, below)

java.lang.UnsatisfiedLinkError: no ocijdbc9 in java.library.path

I've made sure my oracle client was ok (by running TOAD) and I also re-added the classes12.jar / ojdbc14.jars to my WEB-INF/lib folder taken directly from my %ORACLE_HOME% folder (also re-added them to the lib path). I've also tried just adding the ojdbc14.jar without the classes12.jar. Any suggestions appreciated.

In the XP VM I have my PATH variable set to C:\Program Files\Java\jdk1.6.0_24\bin;C:\ORACLE\product\10.2.0.1\BIN. I'm using Tomcat server 5.0

like image 662
B.Z.B Avatar asked Feb 23 '11 15:02

B.Z.B


People also ask

What is the default Java library PATH?

Its default value depends on the operating system: On Windows, it maps to PATH. On Linux, it maps to LD_LIBRARY_PATH. On OS X, it maps to DYLD_LIBRARY_PATH.

How do I find Java library PATH in Windows?

Start -> Control Panel -> System -> Advanced. Click on Environment Variables, under System Variables, find PATH, and click on it. In the Edit windows, modify PATH by adding the location of the class to the value for PATH.

What is UnsatisfiedLinkError in Java?

public class UnsatisfiedLinkError extends LinkageError. Thrown if the Java Virtual Machine cannot find an appropriate native-language definition of a method declared native .


1 Answers

I agree with the advice you've gotten in the comments to use the thin driver instead of the OCI driver if you can. It is simpler and it should bypass the problem you're having.

If you do need the OCI driver for some reason, your problem is that the DLLs are not on your Java library path. This is separate from the classpath that is used to locate class definitions. The clues here are (a) the fact that the error references java.library.path, and (b) the fact that you are getting an UnsatisfiedLinkError rather than a ClassNotFoundException.

You would need to set your java.library.path property to include the location of the DLLs, or add the location of the DLLs to the Windows PATH, in order for Java to locate them.

More information here: http://forums.oracle.com/forums/thread.jspa?threadID=615281

like image 72
Dave Costa Avatar answered Oct 21 '22 05:10

Dave Costa