Calling JNI from within a ejb

Hi,

I'm trying to call a native method from a EJBean class,using iPlanet App Server, after deployment, when i run, I'm getting the following error,

"com.netscape.server.eb.UncheckedException: java.lang.Error thrown by impl nextgensecurity.NgtnSecurityBean@1ade762, err = java.lang.UnsatisfiedLinkError: validateinHSM "

But the same thing is working when tried with a simple java class,

can any one help regarding this ASAP,

Thanx in advance

Kiran

[499 byte] By [Dkiran] at [2007-9-26 11:38:27]
# 1

It works one place but not another...then something is wrong with the environment.

Every OS has a 'shared path' setup. In windows this is the env var PATH. In unix it is something like 'LD_LIB_PATH'. This must be set in the environment that runs. For you this could mean it isn't set for the user that runs the app server or it could be a configuration element in the app server.

jschell at 2007-7-2 1:43:47 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2

Hi Joe,

Thanks a lot for ur reply,

But the LD_LIBRARY PATH is set to the user that runs the App Server, Since it is throwing a UnsatisfiedLinkError, there must be a problem with the link only(i.e calling native method).

The flow of data is as follows

1A method from ejb calls another java method in an other java class which is in the same jar file,passing the actual arguments.

2That java method calls the Native methos residing in the same class file

3 The Native mentod calls a c function as usual

My ejb is working fine up to the Native Method call, at this point it is throwing an error

All my java files are in a package, and my .h file contains package name in the prototype of c function

If you get any ideas please mail me ASAP

ThanQ

Kiran

Dkiran at 2007-7-2 1:43:47 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 3

Let me repeat is again.

If it works on one computer and not the other then there is something wrong with the environment.

Some possibilities:

-Different versions/vendors of java

-Different jars/classes (your jars and classes do not match)

-Different shared libraries (different version of shared library)

-Different system shared libraries

-Different environment vars (including PATH and shared)

-Different permision levels

Notice that in the above it does not mention code nor bugs in the code. That is because if it works on one machine, by definition, that means the code works.

jschell at 2007-7-2 1:43:47 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 4

Let me repeat is again.

If it works on one computer and not the other then there is something wrong with the environment.

Some possibilities:

-Different versions/vendors of java

-Different jars/classes (your jars and classes do not match)

-Different shared libraries (different version of shared library)

-Different system shared libraries

-Different environment vars (including PATH and shared)

-Different permision levels

Notice that in the above it does not mention code nor bugs in the code. That is because if it works on one machine, by definition, that means the code works.

jschell at 2007-7-2 1:43:47 > top of Java-index,Java HotSpot Virtual Machine,Specifications...