I have a Web application which includes an abstract class: "TransactionImport".

I compiled a subclass of TransactionImport (AudiBankImporter), placed
the class in a jar, then placed the jar in $CATALINA_HOME/lib.

What I'd like to do is load the compiled AudiBankImporter class from
the Web application at runtime. When I do this using Class.forName()
or ClassLoader.loadClass(), I get "java.lang.NoClassDefFoundError:
TransactionImport".

If I change AudiBankImporter so that it no longer subclasses
TransactionImport, I am able to load the class.

I feel like I'm missing something fundamental about class loading in
general or Tomcat classloaders, but I don't know what.

If this isn't enough information to help me, I can code up a simple
example. Basically what I'm trying to do is allow users to make
plugins for my Web application, and force their plugins to subclass an
abstract class I define. I could probably also use an interface or an
actual class if that would work better in Tomcat.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to