File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Vanishing JNI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Vanishing JNI" Watch "Vanishing JNI" New topic

Vanishing JNI

AS Morgan

Joined: Sep 11, 2007
Posts: 2
We're using the Lindo API (math optimizer) as a shared/lib jar in Tomcat 5.0.28 under RedHat (2.6.9-5). The jar itself is a JNI wrapper for the engine.

It works fine, for a time. Intermittently, and at fairly random intervals, attempts to reference classes from that jar throw an ERROR "no lindojni in java.library.path". No exception is generated, even with X:checkjni enabled. It just sort of stops answering the phone. It may run without problems for a week, then die. Maybe next time its a day.

Ben Souther

Joined: Dec 11, 2004
Posts: 13410

We have to use some JNI stuff where I work and we've seen flaky behavior if we try to either do a hot deploy or if we stop and start and individual application without a clean restart of Tomcat (and thus the entire JVM).

Are you doing any of these things?

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
AS Morgan

Joined: Sep 11, 2007
Posts: 2
We always do a full Tomcat restart for other reasons related mostly to some poor initial design choices. We do hot swaps of JSPs, but that's it.

That being said, there was a script that would restart tomcat via shutdown/startup, but didn't wait for the shutdown to finish. When we tried using this script, we got the same behavior from the JNI library.
I agree. Here's the link:
subject: Vanishing JNI
It's not a secret anymore!