Operating System - HP-UX
1833758 Members
3168 Online
110063 Solutions
New Discussion

Error massage when testing ocijdbc installation

 
Steve Yang_2
Advisor

Error massage when testing ocijdbc installation

I got a small program from oracle metalink and ran on my HP box, found the strange error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: /u01/apps/oracle/9.2.0/lib/libocijdbc9.sl: specified file is not a shared library, or a format error was detected.
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1585)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1485)
at java.lang.Runtime.loadLibrary0(Runtime.java:788)
at java.lang.System.loadLibrary(System.java:834)
at Test.main(Test.java:7)


The java program is as follows:

public class Test {

public static void main (String [] args)
{
try
{
System.loadLibrary("ocijdbc9");
System.out.println("Successfully Loaded");
} catch(Exception e)
{
System.out.println("SHLIB_PATH is not properly set");
e.printStackTrace();
}
}

}

Any idea?

Thank you in advance
steve_yxf
3 REPLIES 3
Jeff Schussele
Honored Contributor

Re: Error massage when testing ocijdbc installation

Hi Steve,

You need to verify just *which* Java this expects. Then fulfill that need.
OR you have a SHLIB_PATH var that needs to be set.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Steve Yang_2
Advisor

Re: Error massage when testing ocijdbc installation

Jeff:

Sorry to forgot to put the platform.

HP_UX11.00
JDK1.4.2 for HP
Oracle 9.2.0.1 for HP_UX 64 bit

The SHLIB_PATH is set to $ORACLE_HOME/lib, which contains the ocijdbc file libs.

Thanks
steve_yxf
Jeff Schussele
Honored Contributor

Re: Error massage when testing ocijdbc installation

OK, Then you have to realize there are 2 Java installations - RTE (Run-Time Env.) and SDK (Systems Developer's Kit) and they have totally different libray filesets.
I suspect you may have the former & need the latter - or vice-versa.
Run swlist | grep -i java & see just which one you have & install the other.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!