tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guy Verbist <guy.verb...@prosumersolutions.com>
Subject RE: Problem with loading classes dynamically, new objects can't " see" things in webapp.
Date Wed, 12 Sep 2001 08:53:57 GMT
Hi again Craig.

> If ProsumerTestTag is being loaded from the class path, it's 
> being loaded
> by the system class loader.
> 
> If CustomTag is being loaded from the web app, it is being 
> loaded from the
> webapp class loader.

Judging by printing out the name of the classloaders being used at various
times, I was beginning to get this impression.

> Classes loaded from the system class loader CANNOT see 
> classes loaded from
> the webapp class loader -- therefore, Tomcat is telling you the truth.
> These restrictions are based on the way class loaders work in Java, so
> there's nothing Tomcat can do about it.

Right, I wasn't aware of this at all.

> Note that any of the following should work:
> * Put CustomTag and ProsumerTestTag both on the classpath
> * Put CustomTag and ProsumerTestTag both in the webapp
> * Put CustomTag on the classpath and ProsumerTestTag in the webapp
>   (webapp class loaders can look "up" the class loader hierarchy)

OK, I've tried your first suggestion, and that works.

Many thanks indeed for your authoritative answer.

Cheers,

Guy

Mime
View raw message