wood burning stoves*
The moose likes JDBC and the fly likes UnsatisfiedLinkError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "UnsatisfiedLinkError" Watch "UnsatisfiedLinkError" New topic
Author

UnsatisfiedLinkError

John Ryan
Ranch Hand

Joined: Mar 14, 2001
Posts: 124
Hi all,
I am trying to execute some tests on Solaris using an Oracle 9i database and using the Oracle ojdbc14.jar driver. However each time I try to make a call I get the following error:
java.lang.UnsatisfiedLinkError:
/export/home3/oracle/product/9.2.0.4/lib/libocijdbc9.so:
ld.so.1: java:
fatal: /export/home3/oracle/product/9.2.0.4/lib/libocijdbc9.so: wrong ELF class: ELFCLASS64

Now from what Ive read an UnsatisfiedLinkError occurs when a native method cannot be called correctly. My tests are being executed on Solaris and from the Java manuals it says that shared libraries for native method implementations are found using the LD_LIBRARY_PATH environment variable. Ive checked the value of this variable against another its value for another user account on which the tests work and the values of the variable are identical. What I am wondering is if there is any other environment variable that could be affecting how the JVM locates native methods?
Cheers,
John
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

Originally posted by John Ryan:
Hi all,
I am trying to execute some tests on Solaris using an Oracle 9i database and using the Oracle ojdbc14.jar driver. However each time I try to make a call I get the following error:
java.lang.UnsatisfiedLinkError:
/export/home3/oracle/product/9.2.0.4/lib/libocijdbc9.so:
ld.so.1: java:
fatal: /export/home3/oracle/product/9.2.0.4/lib/libocijdbc9.so: wrong ELF class: ELFCLASS64

Now from what Ive read an UnsatisfiedLinkError occurs when a native method cannot be called correctly. My tests are being executed on Solaris and from the Java manuals it says that shared libraries for native method implementations are found using the LD_LIBRARY_PATH environment variable. Ive checked the value of this variable against another its value for another user account on which the tests work and the values of the variable are identical. What I am wondering is if there is any other environment variable that could be affecting how the JVM locates native methods?
Cheers,
John

Everything I've read says this is caused by using the 64bit libraries instead of the 32bit ones. Change your LD_LIBRARY_PATH to point to $ORACLE_HOME/lib32.

Jamie
John Ryan
Ranch Hand

Joined: Mar 14, 2001
Posts: 124
Thanks Jamie, Tried this and my tests work correctly now. Need to spend some time figuring ot why this fixed it now. Dont fully understand that yet.....
 
 
subject: UnsatisfiedLinkError