Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem:Apache Jserv+JNI calls

0 views
Skip to first unread message

devrim baris acar

unread,
Sep 21, 1999, 3:00:00 AM9/21/99
to
Hi,
I have these errors logged in Apache's error logs when the servlet(code down
there) tried to run.
system:redhat 6.0 2.2.12. JDK 1.1.7

I compiled the code with
gcc -fPIC -c -I/usr/local/java/include hello.c -o hello.o
and linked it with
ld -shared hello.o -o libhello.so
cp libhello.so /usr/lib
cp libhello.so /lib (for grant)
and finally
ldconfig -n /usr/lib
ldconfig -n /lib

And restart apache. And as I try to run the servlet i get the error messages
down there.
they mention a LD_LIBRARY_PATH environment variable which i think that not
used in redhat 6.0. Instead
i have seen a /etc/ld.so.conf where library paths are defined.
Should I use a this environment variable? Or any other suggestions to
overcome this problem.
By the way except this servlet I made the tutorial example from Sun's Java
Tutorial work.

Source code: (Only the part that causes the error is here, The code without
that "static" part used to work)
------------
import java.io.*;
import javax.servlet.*;
import javax.servlet.....
.............
....;
public class saved2 extends HttpServlet
{
Connection con;
int mu;
public native int authenticate();

static {
try
{
System.loadLibrary("hello");
}
catch (Exception E)
{
}
}

Output of jserv.log:
--------------------
[20/09/1999 12:10:33:723] (ERROR) ajp11: Servlet Error:
java.lang.UnsatisfiedLinkError: authenticate: authenticate
[20/09/1999 12:10:33:723] (ERROR) an error returned handling request via
protocol "ajpv11"

And this is the output of Apache error log:
-------------------------------------------
java.lang.UnsatisfiedLinkError: authenticate
at
org.apache.jserv.JServConnection.processRequest(JServConnection.java:341)
at org.apache.jserv.JServConnection.run(JServConnection.java:197)
at java.lang.Thread.run(Thread.java)

Baris

0 new messages