Jump to content
Excelsior Forums
hban

java.lang.UnsatisfiedLinkError on javax.crypto.SecretKeyFactory instantiation

Recommended Posts

Hi,

My "Invocation DLL" application throws a java.lang.UnsatisfiedLinkError error when it is executed on a target box.

Both the target and dev boxes are running Linux.

The application runs fine on my dev box, provided I build it from the command line, and not the Excelsior UI.

When I build it from the UI, I get the same error.

I copied the generated .so file, as well as the JET Profile folder, to the target box.

The invocation C code(the sample code, tweaked), was re-compiled on the target box.

On invocation, the part of the Java code that throws an error is where I instantiate "javax.crypto.SecretKeyFactory".

The rest of the code appears to run fine.

The JDK on the target box (1.6.0_26) is slightly different than the one on the dev box(1.6.0_13).

Do you think that this might cause any problems, considering that I need to specify the JDK when compiling the C code?

Any suggestions would be very appreciated.

Here's the error trace thrown:

Exception in thread "main" java.lang.UnsatisfiedLinkError: exception occurred in JNI_OnLoad

at java.lang.ClassLoader$NativeLibrary.load(Unknown Source)

at java.lang.ClassLoader.loadLibrary0(Unknown Source)

at java.lang.ClassLoader.loadLibrary(Unknown Source)

at java.lang.Runtime.loadLibrary0(Unknown Source)

at java.lang.System.<unknown>(Unknown Source)

at sun.security.action.LoadLibraryAction.run(Unknown Source)

at java.security.AccessController.doPrivileged(Unknown Source)

at java.net.InetAddress.<clinit>(Unknown Source)

at com.excelsior.jet.runtime.classload.ClassInitialization.__aj__initClass__Lcom_excelsior_jet_runtime_typedesc_ClassOrInterfTypeDesc_2(Unknown Source)

at java.net.InetAddress.getLocalHost(Unknown Source)

at javax.crypto.SunJCE_b.j(Unknown Source)

at javax.crypto.SunJCE_b.d(Unknown Source)

at javax.crypto.SunJCE_b.c(Unknown Source)

at javax.crypto.SunJCE_b$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Unknown Source)

at javax.crypto.SunJCE_b.<clinit>(Unknown Source)

at com.excelsior.jet.runtime.classload.ClassInitialization.__aj__initClass__Lcom_excelsior_jet_runtime_typedesc_ClassOrInterfTypeDesc_2(Unknown Source)

at javax.crypto.SunJCE_b.b(Unknown Source)

at javax.crypto.SecretKeyFactory.a(Unknown Source)

at javax.crypto.SecretKeyFactory.<unknown>(Unknown Source)

at javax.crypto.SecretKeyFactory.getInstance(Unknown Source)

at com.travelport.invoker.InvokeMCE.invokeAndGetResponse(Unknown Source)

Thanks,

Hirak

Share this post


Link to post
Share on other sites

Hi,

First of all, please use JetPackII tool (included in JET) in order to package and deploy your application to the target system.

For more information, see JET User's Guide, chapter "Deployment automation"

Secondly, please make sure that LD_LIBRARY_PATH is set for JET runtime. If JET runtime is installed to a directory ${JETRT}, then LD_LIBRARY_PATH should contain

${JETRT}/jre/lib/i386:${JETRT}/jre/lib/i386/jetvm

On the development system ${JETRT} stands for <JET installation directory>/profile<Java version>. On the target system it depends on the application installation path and JetPackII settings ("rt" subdirectory of application directory by default).

Setting of LD_LIBRARY_PATH is usually performed when JET-compiled executable is launched, but in your case (Invocation DLL) it should be set manually.

Note that LD_LIBRARY_PATH should not point to any other JDK/JREs including Oracle JRE.

The JDK on the target box (1.6.0_26) is slightly different than the one on the dev box(1.6.0_13).

Do you think that this might cause any problems, considering that I need to specify the JDK when compiling the C code?

Usually, when compiling C code, JDK is used just to specify directories with jni.h/jni_md.h include files.

These include files specify JNI interface which is the same for different JDK micro-versions (and even for different JVMs).

So, in such case, the difference in the micro-version of installed JDKs doesn't matter.

Regards,

-AlexM

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×