DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=40315>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ· INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=40315 Summary: WebAppClassLoader behavior when getting resource "/" Product: Tomcat 5 Version: 5.5.14 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: Catalina AssignedTo: tomcat-dev@jakarta.apache.org ReportedBy: [EMAIL PROTECTED] Call to class.getResourceAsStream("/") on a class loaded from webapp classpath (e.g. from a jar in WEB-INF/lib) returns directory listing for directory from where catalina was started. Apart from a potential security issue, this causes inconsistency in the classloader behavior (different results depending on how the container got started). In our case, we use C3P0 connection pool which for some strange reason happens to read "/" resource during initialization, and executing startup.sh from a read-protected directory causes webapp fail to load with an NPE with the following stack trace (only the relevant portion shown): Caused by: java.lang.NullPointerException at java.util.Arrays$ArrayList.<init>(Arrays.java:2355) at java.util.Arrays.asList(Arrays.java:2341) at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:67) at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161) at java.net.URL.openStream(URL.java:1007) at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1161) at org.apache.catalina.loader.WebappClassLoader.getResourceAsStream(WebappClassLoader.java:1170) ... -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]