Hi folks,

I am a newbie ... I have been trying to do a simple .jsp page that
makes use of a JNI call to a simple HelloWorld .so lib. Here is what i
did..


1. Made a class called HelloWorld.java inside a package "cal" with a
native method displayHello()
2. compiled it with javac
->> gave me HelloWorld.class
3. created the header file using "javah -jni cal.HelloWorld"
->> this gave me cal_HelloWorld.h file
4 created a HelloWorldImp.c file ..included the header file and also
made the export line in the file reflect the package name
(i.e) Java_cal_HelloWorld_displayHello()
5. Compiled .c file using gcc -c -o libHello.o -I path to jdkincludes
6. built the shared object using "cc -shared -o libHello.so libHello.o"
7. exported LD_LIBRARY_PATH with the right path to the .so file dir

8. created a simple Foo.jsp file to have 
    try{
              System.loadLibrary("Hello");
       }catch( UnsatisfiedLinkError e){
              }

      new HelloWorld ().displayHello();

-----------------------
that's it... now all these works until i call the displayHello()
method from my HelloWorld class. I am sure the server is loading the
libHello.so file. But when I try to call the method that internally is
supposed to invoke the native method it fails with
UnsatisfiedLinkError. The same lib can be used with a simple
standalone java program and it WORKS FINE !! I am so lost with this
:o( Any help in this regard would be appreciated. Thanks in advance
for your time !

cheerz
-vaheesan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to