tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Hirner" <>
Subject AW: Native library cannot be loaded twice
Date Mon, 24 Jun 2002 13:19:36 GMT
> What kind of native library are you loading ? (Sorry, I don't know
> former emails!)

I am working on Linux and set the path to the shared C library using

> If you working on Unix and you are loading a shared lib you must
ensure that
> the path to the lib is know to the tomcat process. Either you
configure the
> tomcate environment (catalina) or use the LD_LIBRARY_PATH
> variable. Manipulating an environment variable is not the best idea
> it effects the whole system - and this is neither allowed  nor
> This should also work for Windows where the path to the dll must be
> either in the catalina.bat file or by modifying the system wide

The problem is, that I can load the library in the servlet and make it
work. However if I change the servlet and reload the application via
manager/reload command, the library is loaded a second time and thus
causes a conflict. I have to start the application to view any
changes, which is rather cumbersome if you are still developing.
That's why I wrote the InitMapserver class and called it from the
servlet in the Class.forName() method.

Looking at your second mail:

> A look into your code (InitMapserver) shows, that the runtime system
> initialize the static resource in the common way, because it first
> generate an object and this object contains code for doing some
> stuff. Maybe this is the reason for the strange behavior

How do I go about this. Do I have use a constructor?

Thanx Andreas

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message