On Mon, 11 Feb 2002, Larry Meadors wrote:
> After more that a week of messing with it, I'm convinced there is no
> way to call native methods within Tomcat. I have read the class loader
> INFO file 100 times, searched and read the list serve archives for
> hours, followed all the suggestions found within those messages, and
> still I receive "UnsatisfiedLinkErrors" whenever I attempt to run native
> methods.
>
> Facts:
>
> * I can execute the methods with no problems when run from the command
> line, but I get "UnsatisfiedLinkErrors" running under Tomcat 4.0.1.
> Hummm...
>
I never do this in "real life", so all I can offer is suppositions:
> Questions:
>
> * Can the class loader used to load the classes in the web app load
> native libraries with System.loadLibrary? Some list serve messages say
> no, others suggest yes.
Class loaders are *not* used to load native code itself -- my
understanding is that native libraries have to be found on the PATH
environment variable, not the CLASSPATH. You also need to ensure that a
particular native library is loaded once and only once (even in the face
of application restarts) within a single (Tomcat) JVM.
However, the Java stubs that represent the native methods *are* made
visible through a class loader -- and you will need this to be done in a
classloader that is visible to all your apps.
> * Do I really need to load my class with the native methods in the
> "Common" class loader? If so, how? None of the methods I have tried
> work.
Based on the above, I wouls assume the answer is yes.
> * Basically, how do I need to sweet talk Tomcat to make it execute my
> native methods?
>
> I'm really frustrated and desperate! If anyone has made this work,
> please share your wisdom. I am a big fan of open source, but the
> troubles I am having really make me wish I could call tech support at
> some software company! Any suggestions are welcome. Thanks..
>
> Cheers,
>
> Jim Boone
>
>
Craig
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>