tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brock Noland <>
Subject Sharing Native Library from parent classloader?
Date Sat, 07 Aug 2010 15:18:50 GMT

I have a legacy application written in C.  The library is wrapped in JAVA as
the supporting applications are all JAVA based. The problem we are running
into is that although the library is thread safe the java wrapper is not.
 Changing the wrapper would be a major change. As such, we have to run many
JVMs on a single host which is eating memory like crazy.  We have tens of
thousands of these JVMs. My goal is to wrap around the non-thread safe
wrapper and reduce JVM overhead.

I remembered that Tomcat had different class loaders for each web
application and have successfully been able to load two different wrappers
from two "applications."  However, I cannot load the native library in the
two classloaders. I understand this is JVM limitation. I do wonder, however,
if I can load the library in a parent class loader?  I have tried this but I
am getting UnsatisfiedLinkError when the native methods are called.

Is there any workaround for this?  I see tomcat uses some native APR library
and I was wondering if you have found a workaround? I see towards the bottom
of this bug report, someone seems to have a hack regarding System.out.

That probably would not fly for me.

Thanks for your time,
Brock Noland

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message