-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Dennis,
On 7/5/2010 3:35 AM, dennis ch wrote:
> modelJNI.java
> ===
> public final static native void initModel();
>
> native code
> =
> #include
> #include
> #include
[snip]
> void initModel() {
You can't use JNI like that. Y
Had You tried to made c header by javah -jni
./your_packages/your_class.class ?
It gives header for You with properly named method to be written in c..
On Mon, Jul 5, 2010 at 4:11 PM, Konstantin Kolinko
wrote:
> 2010/7/2 dennis ch :
> > Do I miss anything here? Any input is appreciated!
> >
>
>
2010/7/2 dennis ch :
> Do I miss anything here? Any input is appreciated!
>
IIRC, native libraries can be loaded only once,
but webapplication classloader is disposed and recreated each time the
web application is stopped/reloaded. Thus the class that loads your
library must be in ${catalina.base
Hi Shay,
Thanks for your input. And yes, I did see the "Load library successful"
message. I've also fixed the code with static { } block. However, I still
received the same error message. Any other thoughts?
Thanks,
Dennis
2010/7/2 Shay Rojansky
> Hi Dennis.
>
> So do you see the "Load lib
lson=mediacomcc@tomcat.apache.org[users-return-214329-racarlson=
> mediacomcc@tomcat.apache.org] On Behalf Of Shay Rojansky [
> r...@roji.org]
> Sent: Saturday, July 03, 2010 12:40 AM
> To: Tomcat Users List
> Subject: Re: JNI error under tomcat: java.lang.UnsatisfiedLinkError
>
&
Hi Chris,
Thanks for your reply. I recompiled everything and checked method
signature, but still got the same error. I felt it's weird why it worked
for standalone app but not deployed web service... Thanks.
model.java
public static void initModel() {
modelJNI.initModel();
}
Behalf Of
Shay Rojansky [r...@roji.org]
Sent: Saturday, July 03, 2010 12:40 AM
To: Tomcat Users List
Subject: Re: JNI error under tomcat: java.lang.UnsatisfiedLinkError
Hi Dennis.
So do you see the "Load library successful" message?
Also, if I remember correctly, the code in eval.java is
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Dennis,
On 7/2/2010 3:46 AM, dennis ch wrote:
> However, when I deploy it as a web service (tomcat 6.0.26 + axis2 1.5.1 +
> eclipse jee helios) to call the native method, I got the following error
> (the first line means the .so was successfully loade
Hi Dennis.
So do you see the "Load library successful" message?
Also, if I remember correctly, the code in eval.java is not a safe way to
load a native library. It's a very good idea to place the System.loadLibrary
in a static { } block, instead of in a method. The way your class is
written, it's