Nathan,

I am developing an imaging servlet under Tomcat 4.1.12 using JAI 1.1.2.
Every time I update my code to add new features, it will return with a
NoClassDefFoundError until I restart Tomcat.  At that point, it finds
the 'missing' class and everything works as expected.

I'm no expert on JAI, but I believe that it uses JNI and a native library to do some of it's dirty work. If that's the case, then you should make sure that the JAI JAR file and native library are loaded by a classloader outside ("higher than") your webapp.

There's documentation on the Tomcat site (and probably other servlet
containers, too) that says that native libraries should only be loaded
one time. IF they get loaded multiple times (as would happen if they
were loaded by the webapp), strange behavior can result.

Try putting jai.jar (or whatever) into TOMCAT_HOME/common/lib and jai.so
(or whatever) in a convenient place where it can be found. (Sorry, dunno
where that might be. Anyone else?)

Hope that helps,
-chris


Attachment: signature.asc
Description: PGP signature

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to