Tomcat: possible to exclude jars during app deployment?

Solution 1:

You check/filter what web apps load using a custom loader extending from org.apache.catalina.loader.WebappClassLoader as mentioned in the Tomcat documentation.

Check out Tomcat's implementation (7.0.19) of the standard WebAppClassLoader that implements the filtering of javax.servlet.Servlet to get started. It's probably enough to override that class and just put some more entries into the protected String[] fields triggers and packageTriggers.