B.Z.B
B.Z.B

Reputation: 471

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

Upvotes: 9

Views: 38452

Answers (5)

maverick
maverick

Reputation: 1

I had the same problem while using MyEclipse. One needs to set the path to oracle clients lib and bin folder. Attaching image for reference. Hope it helps enter image description here

Upvotes: 0

Trentman
Trentman

Reputation: 21

I have encountered this same error twice recently. The first time I managed to resolve it without knowing exactly what I did. Don't you just hate that because when it shows up again what do you do? Well it did show up again when I had to create a new project in eclipse. This time I know what the problem was and it is a very simple thing to overlook and fix. The other posters have great information but it won't help you if you have the same root cause that I had and I believe that you do...

The issue was simple and it was this: I had two different ojdbcXX.jar files in my Java buildpath (within Eclipse). I had both ojdbc14.jar and ojdbc6.jar Apparently it was hitting ojdbc14.jar first and then throwing the error. Once I removed the unnecessary jar file then the error went away. Drove me crazy for an entire day before I realized what was wrong!

I hope this helps.

Upvotes: 2

Le Truong Uy Phu
Le Truong Uy Phu

Reputation: 1

I also meet this error when i use DBvisualize to connect Oracle database. I think it is because you have not yet installed Oracle Client. After installing it, maybe it is ok

Upvotes: 0

Kumar S
Kumar S

Reputation: 441

This error occurs when you have a wrong/older version of oci.dll. After setting the path and reverting to the correct oci.dll, the error went away.

Upvotes: 0

Dave Costa
Dave Costa

Reputation: 48111

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

Upvotes: 3

Related Questions