Java Exception : java.lang.UnsatisfiedLinkError: ocijdbc11.dll: %1 is not a valid Win32 application
Asked Answered
B

5

6

I am trying to make a connection to oracle through java program. Following is the configuration.

  1. Windows 7, 64 bit.
  2. JDK 1.6
  3. Oracle client 11g R2, 64 bit.
  4. ojdbc6.jar in the class path of my standalone application.

But I am getting following exception- "java.lang.UnsatisfiedLinkError: \bin\ocijdbc11.dll: %1 is not a valid Win32 application"

I googled alot but was not able to figure out the solution.

Please help me solve this problem.

Thanks in advance.

Bryna answered 18/1, 2012 at 8:47 Comment(7)
is your jdk 64 bit? Most likely is a 32 bit ( from the error message)Earley
Seems like you did not set the ORACLE_HOME environment variable to point to where your oracle installation is. \bin\ocijdbc11.dll should have been c:\xxxxxx\bin\ocijdbc11.dllLeanaleanard
check if this link helps you coderanch.com/t/564587/JBoss/Jboss-Oracle-ocijdbc-dll-findSoulless
My ORACLE_HOME alos points to the dll, still getting the same error.Bryna
@Pun Sri : For some reason you application is 32 bit. How are you running the app? Could you check the java path?Earley
I am running it from eclipse, right click on java program and run as java application.Bryna
Check at the Eclipse project properties which JDK version is aplied to your project. Also check it at the Run/Debug configuration which you use to start the app. If you have multiple JDKs installed, it's easy that Eclipse is defaulting to other than the last installedWoodwind
W
1

This error seems to be related with the compatibility of the OCI driver version with your Windows version.
Check if your OCI driver is compatible with a 32 bit architecture or else is for a 64 bit (and hence the error).

Here (https://forums.oracle.com/forums/thread.jspa?threadID=2189215) you can find a close related error (same error, for a different library), which finally was fixed downloading the S.O. specific version of the library and reinstalling it.

EDIT: so, after your edition, it seems that you have to install the 64 bit JDK and run your application on it, as your driver and your OS are aligned (64 bit).

Woodwind answered 18/1, 2012 at 8:56 Comment(0)
A
0

This error may also come from 64 bit version of Java 7 and using 32 bit Oracle drivers. An application I used was supposed to use 32 bit Java 6, but an administrator installed Java 7, which apparently caused this error.

Acetanilide answered 19/3, 2012 at 19:7 Comment(0)
R
0

This error only happen on windows, to solve just copy your dll's into C:\Windows\System32, it works for me!

Regenerate answered 12/3, 2017 at 22:16 Comment(0)
B
0

Firstly, you should have Oracle client 12 of 64 bit installed. Secondly, copy ocijdbc11.dll to JDK--> inside bin folder and also to C:\Windows\System32 folder.

This should probably work.

Benoit answered 1/2, 2023 at 18:53 Comment(0)
B
0

In my case This issue was due to 64-bit jdk trying to connect to Oracle client 32-bit. I was able to fix the issue by downloading Oracle client of 64-bit on my machine which made the connection of 64-bit jdk to 64-bit Oracle.

Benoit answered 12/10, 2023 at 14:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.