Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

on RELOAD of Tomcat *.so library already loaded in another classloader

843829Feb 24 2004 — edited Mar 9 2004
Setup
--------------
Tomcat 4.1.29
Red Hat 7.2 (glib-1.2.10-11.1)

Problem
---------------
I am using a JNI library called test.so. Everything works file untill the following.

As we know tomcat provides a manager utility to reload/deploy web application WITHOUT restarting the tomcat. This way we can reload an application(context) w/o affecting any other app.

In the tomcat manager (www.url.com/manager/html) , when I "RELOAD" the app. which uses the JNI, i get this error.


type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Native Library /tomcat29/jakarta-tomcat-4.1.29/webapps/v2/WEB-INF/jni/test.so already loaded in another classloader
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
................................................................................................................
root cause

javax.servlet.ServletException: Native Library /tomcat29/jakarta-tomcat-4.1.29/webapps/v2/WEB-INF/jni/test.so already loaded in another classloader
at org.apache.jasper.runtime.PageContextImpl.handlePageException
......................................................................................................................


This is the code which load the JNI library

public void callinit(){

try {
System.loadLibrary("test");
Init();
} catch (Exception e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
}

All the suggestions are welcomed....

Thanks in advance.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 6 2004
Added on Feb 24 2004
10 comments
1,812 views