Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

UnsatisfiedLinkError

 
John Ryan
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic