tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r646543 - /tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java
Date Wed, 09 Apr 2008 21:19:04 GMT
Author: markt
Date: Wed Apr  9 14:19:02 2008
New Revision: 646543

URL: http://svn.apache.org/viewvc?rev=646543&view=rev
Log:
Handle case where we don't have permission to read context specific configuration.

Modified:
    tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java

Modified: tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java?rev=646543&r1=646542&r2=646543&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java (original)
+++ tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java Wed Apr  9 14:19:02 2008
@@ -22,6 +22,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URLClassLoader;
+import java.security.AccessControlException;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.Collections;
@@ -296,9 +297,14 @@
         InputStream is = null;
         // Special case for URL classloaders which are used in containers: 
         // only look in the local repositories to avoid redefining loggers 20 times
-        if ((classLoader instanceof URLClassLoader) 
-                && (((URLClassLoader) classLoader).findResource("logging.properties")
!= null)) {
-            is = classLoader.getResourceAsStream("logging.properties");
+        try {
+            if ((classLoader instanceof URLClassLoader) 
+                    && (((URLClassLoader) classLoader).findResource("logging.properties")
!= null)) {
+                is = classLoader.getResourceAsStream("logging.properties");
+            }
+        } catch (AccessControlException ace) {
+            // No permission to configure logging in context
+            // Ignore and carry on
         }
         if ((is == null) && (classLoader == ClassLoader.getSystemClassLoader()))
{
             String configFileStr = System.getProperty("java.util.logging.config.file");



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message