Hi..
Sorry, not sure if this the right forum to post this question..
I need to use C API in my
JSP. I have a class file which define all the native method and load the C API in public class MyClass like this:-
public native static byte[] myMethod();
static
{
System.loadLibrary("mycompanycapi");
}
I had compiled this class and the .h file and put it in my webapps/ROOT/WEB-INF/classes/com/mycompany folder under
tomcat.
The libmycompanycapi.so I put it under /lib and I call this class in jsp like this:-
<jsp:useBean id="MyClass" class="MyClass" scope="request">
</jsp:useBean>
But, when the jsp give me the following error:-
exception
org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:591)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.ClassNotFoundException: org.apache.jsp.test_005fbank_jsp
java.net.URLClassLoader$1.run(URLClassLoader.java:199)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:187)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:158)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:71)
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:589)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Can anyone help and advise what is the possible problem to this? Thanks.