Hi,
I have been trying how I can use JNI from within a servlet. I have tried the
code that comes
with Apache-jserv. Servlets compile and run without any problem. The problem
is with javah.
After a successful compilation (i hope) when I try to make a C header file,
it gives
the error below.
I would be *very* glad if you helped me .
Devrim Baris Acar
PS:For over two days I have been wandering around the net and searching for
an example
implementation but I couldn't.Sorry if you have read about the problem also
in java.lang.programmer.
System: rh 6.0 with blackdown jdk glibc version 1.1.7 . The classpath
is ok(i guess) since it compiles and runs without errors.
The error output:
[root@svrlinux1 muha]# javac SimpleServlet.java(no problem here)
[root@svrlinux1 muha]# javah -jni SimpleServlet
Signalled error "java/lang/NoClassDefFoundError" with detail
"javax/servlet/http/HttpServlet"
SimpleServlet: no such class
Here is the code if it helps any way:
import java.*;
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class SimpleServlet extends HttpServlet {
public native void try_it();
public void doGet (HttpServletRequest request,
HttpServletResponse response) throws Servlet$
{
PrintWriter out;
String title = "Simple Servlet Output";
response.setContentType("text/html");
out = response.getWriter();
out.println("<HTML><HEAD><TITLE>");
out.println(title);
out.println("</TITLE></HEAD><BODY>");
out.println("<H1>" + title + "</H1>");
out.println("<P>This is output from SimpleServlet.");
out.println("</BODY></HTML>"); out.close();
}
}
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]