S
steves-un
Does anyone have experience with using JNI in a servlet under Windows
XP? When trying to do this, it continually fails to load the C
library.
It works when done in a normal Java program, but not when it's a
servlet.
I've seen that others have used JNI in Servlets and had this problem
with Windows, but no explanation on how to work around the problem.
I also have problems running javah. It's not required, but it does
work
as a precursor; if javah doesn't work, the library won't load either.
Here's a quick rundown of the setup and errors. I'ms using Java 1.5
with the Sun App Server on a Windows XP SP2 system, compiling the C
code
with gcc v3.3.3. CLASSPATH is set to inculde all directories the files
and libs reside.
When running the servlet, the following errors show up in the App
Server
log file:
Logger: javax.enterprise.system.stream.err
Name-Value Pairs: _ThreadID=29;
Message ID: Link error
Complete Message java.lang.UnsatisfiedLinkError: no jni_if in
java.library.path
Logger: javax.enterprise.system.stream.err
Name-Value Pairs: _ThreadID=12;
Message ID:
Complete Message Exception in thread "Thread-79"
Logger: javax.enterprise.system.stream.err
Name-Value Pairs: _ThreadID=30;
Message ID: java.lang.UnsatisfiedLinkError
Complete Message getXppParm
at xpserv.XppIf.getXppParm(Native Method)
at xpserv.XppIf.run(XppIf.java:61)
Running javah gets the following error:
bash-2.05b$ javah -jni XppIf
error: cannot access XppIf
bad class file: C:\BioSpring\xpserv\XppIf.class
class file contains wrong class: xpserv.XppIf
Please remove or make sure it appears in the correct subdirectory
of the classpath.
com.sun.tools.javac.util.Abort
:
Running javah with the package name included in the name still fails:
bash-2.05b$ javah -jni xpserv.XppIf
error: cannot access xpserv.XppIf
file xpserv\XppIf.class not found
javadoc: error - Class xpserv.XppIf not found.
Error: No classes were specified on the command line. Try -help.
If anybody has had any success in using JNI with a servlet, I would to
hear how they configured it to work.
XP? When trying to do this, it continually fails to load the C
library.
It works when done in a normal Java program, but not when it's a
servlet.
I've seen that others have used JNI in Servlets and had this problem
with Windows, but no explanation on how to work around the problem.
I also have problems running javah. It's not required, but it does
work
as a precursor; if javah doesn't work, the library won't load either.
Here's a quick rundown of the setup and errors. I'ms using Java 1.5
with the Sun App Server on a Windows XP SP2 system, compiling the C
code
with gcc v3.3.3. CLASSPATH is set to inculde all directories the files
and libs reside.
When running the servlet, the following errors show up in the App
Server
log file:
Logger: javax.enterprise.system.stream.err
Name-Value Pairs: _ThreadID=29;
Message ID: Link error
Complete Message java.lang.UnsatisfiedLinkError: no jni_if in
java.library.path
Logger: javax.enterprise.system.stream.err
Name-Value Pairs: _ThreadID=12;
Message ID:
Complete Message Exception in thread "Thread-79"
Logger: javax.enterprise.system.stream.err
Name-Value Pairs: _ThreadID=30;
Message ID: java.lang.UnsatisfiedLinkError
Complete Message getXppParm
at xpserv.XppIf.getXppParm(Native Method)
at xpserv.XppIf.run(XppIf.java:61)
Running javah gets the following error:
bash-2.05b$ javah -jni XppIf
error: cannot access XppIf
bad class file: C:\BioSpring\xpserv\XppIf.class
class file contains wrong class: xpserv.XppIf
Please remove or make sure it appears in the correct subdirectory
of the classpath.
com.sun.tools.javac.util.Abort
:
Running javah with the package name included in the name still fails:
bash-2.05b$ javah -jni xpserv.XppIf
error: cannot access xpserv.XppIf
file xpserv\XppIf.class not found
javadoc: error - Class xpserv.XppIf not found.
Error: No classes were specified on the command line. Try -help.
If anybody has had any success in using JNI with a servlet, I would to
hear how they configured it to work.