Apparently there was some kind of silent failure going on behind the
scenes. It seems that the dynamically loaded JAR needed filesystem read
access to the JAR in WEB-INF/lib, and that both the webapp and the other
JAR needed to have java.net.SocketPermission for connect and resolve
against the database server.

Not sure why this manifested itself as a ClassNotFoundException instead
of a SecurityException telling me that I can't read the PostgreSQL
Driver JAR...

Thanks for your help, everyone!

> -----Original Message-----
> From: Jon Pearson 
> Sent: Thursday, June 11, 2009 1:14 PM
> To: Tomcat Users List
> Subject: Classloader Issues
> 
> I am encountering an odd problem with Tomcat (6.0.18). When the Java
> security manager is enabled, I get a ClassNotFoundException when I try
> to load the Postgres database driver using Class.forName() and a URL
> classloader pointed at a jar; its parent classloader is the Webapp
> classloader.
> 
> But, when the Java security manager is disabled, everything works
> smoothly and no ClassNotFoundException is thrown.
> 
> I've stepped through the code (using Eclipse's debugger) and not found
> anything that stands out, and I've set a general breakpoint on all
> SecurityExceptions, caught or uncaught. None are thrown.
> 
> Has anyone else encountered a problem like this? Is there a 
> way for the
> Java security manager to block a class from loading without a
> SecurityException being thrown?
> 
> Jonathan P. Pearson - Software Engineer
> -------------------------------------------------- 
> SIXNET - Solutions for Your Industrial Networking Challenges
> 331 Ushers Road, Ballston Lake, NY 12019
> Tel: 1.518.877.5173, Fax: 1.518.877.8346
> www.sixnet.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 

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

Reply via email to