do you know if I can count on any predictible behaviour of a servlet container if I have a duplicate class definition in the classpath (for example the same class packaged in two different JARs in /WEB-INF/lib)?
Is that kind of situation addressed anywhere in the servlet specification? Or perhaps in the general JVM (classloader) specification?
That's what I meant, Jeanne - I was wondering whether you can rely on any particular class loading order. And thus - if it's theoretically possible to "patch" a web application without replacing an old JAR, but by adding a new one, which would kind of override the old one. But from what you both said - it isn't. Thanks, both of you.
Would loading the Class in Parent class loader help in such cases?
Based on the principle - "If webapp class loader needs some class it would check if Parent has one and if it is not there then it will try to load it from WEB-INF\lib or WEB-INF\classes".