tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Hirner" <andr...@projektinter.net>
Subject RE: Native library cannot be loaded twice
Date Mon, 24 Jun 2002 10:12:16 GMT
Hi,

ok, I realised that I cannot load a native library twice. So I wrote
and compiled a class called InitMapserver, which looks like that:


 public class InitMapserver
 {

  static {
   try {
      System.loadLibrary("mapscript");
      System.err.println("libmapscript.so loaded");
   } catch (UnsatisfiedLinkError e) {
      System.err.println("libmapscript.so not loaded: " + e);
   }
  }

 }

and put it into the common/classes directory. Then I try to load this
class in a servlet
doing:

 public void init(ServletConfig config) throws ServletException
 {

  try
  {
     Class.forName("InitMapserver");
  } catch (ClassNotFoundException ex) {
     file://throw new ServletException(ex.getMessage() + "Class
InitMapserver not     found");
     System.err.println(ex.getMessage() + "Class InitMapserver not
found");
  }
 }

But I still get the same error message (see below).

Thanx Andreas

################################################
Error Message
################################################

javax.servlet.ServletException: Invoker service() exception
 at
org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServle
t.java:504)
 at
org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:
180)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli
cationFilterChain.java:247)
 at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi
lterChain.java:193)
 at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVa
lve.java:243)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.
java:566)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java
:472)
 at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextVa
lve.java:201)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.
java:566)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java
:472)
 at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2
344)
 at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.ja
va:164)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.
java:566)
 at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcher
Valve.java:170)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.
java:564)
 at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.ja
va:170)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.
java:564)
 at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:4
62)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.
java:564)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java
:472)
 at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValv
e.java:163)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.
java:566)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java
:472)
 at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor
.java:1011)
 at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.jav
a:1106)
 at java.lang.Thread.run(Thread.java:484)
----- Root Cause -----
java.lang.UnsatisfiedLinkError: get_FTString
 at edu.umn.gis.mapscript.mapscript.get_FTString(Native Method)
 at edu.umn.gis.mapscript.mapscript.<clinit>(mapscript.java:767)
 at edu.umn.gis.mapscript.mapObj.<init>(mapObj.java:227)
 at TestLoadLib.doGet(TestLoadLib.java:76)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServle
t.java:446)
 at
org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:
180)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli
cationFilterChain.java:247)
 at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi
lterChain.java:193)
 at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVa
lve.java:243)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.
java:566)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java
:472)
 at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextVa
lve.java:201)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.
java:566)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java
:472)
 at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2
344)
 at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.ja
va:164)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.
java:566)
 at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcher
Valve.java:170)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.
java:564)
 at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.ja
va:170)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.
java:564)
 at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:4
62)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.
java:564)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java
:472)
 at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValv
e.java:163)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.
java:566)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java
:472)
 at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor
.java:1011)
 at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.jav
a:1106)
 at java.lang.Thread.run(Thread.java:484)



--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message