Author: markt
Date: Wed Apr 22 20:05:02 2015
New Revision: 1675486

URL: http://svn.apache.org/r1675486
Log:
Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=57841
Improve error logging during context start

Modified:
    tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties
    tomcat/trunk/java/org/apache/catalina/core/StandardContext.java

Modified: tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties?rev=1675486&r1=1675485&r2=1675486&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties 
(original)
+++ tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties Wed Apr 
22 20:05:02 2015
@@ -108,16 +108,20 @@ standardContext.backgroundProcess.loader
 standardContext.backgroundProcess.manager=Exception processing manager {0} 
background process
 standardContext.backgroundProcess.resources=Exception processing resources {0} 
background process
 standardContext.cluster.noManager=No manager found. Checking if cluster 
manager should be used. Cluster configured: [{0}], Application distributable: 
[{1}]
+standardContext.configurationFail=One or more components marked the context as 
not correctly configured
 standardContext.duplicateListener=The listener "{0}" is already configured for 
this context. The duplicate definition has been ignored.
 standardContext.errorPage.error=Error page location {0} must start with a ''/''
 standardContext.errorPage.required=ErrorPage cannot be null
 standardContext.errorPage.warning=WARNING: Error page location {0} must start 
with a ''/'' in Servlet 2.4
+standardContext.extensionValidationError=Error while attempting to validate 
required application extensions
+standardContext.filterFail=One or more Filters failed to start. Full details 
will be found in the appropriate container log file
 standardContext.filterMap.either=Filter mapping must specify either a 
<url-pattern> or a <servlet-name>
 standardContext.filterMap.name=Filter mapping specifies an unknown filter name 
{0}
 standardContext.filterMap.pattern=Invalid <url-pattern> {0} in filter mapping
 standardContext.filterStart=Exception starting filter {0}
 standardContext.requestListener.requestInit=Exception sending request 
initialized lifecycle event to listener instance of class {0}
 standardContext.isUnavailable=This application is not currently available
+standardContext.listenerFail=One or more listeners failed to start. Full 
details will be found in the appropriate container log file
 standardContext.listenerStart=Exception sending context initialized event to 
listener instance of class {0}
 standardContext.listenerStop=Exception sending context destroyed event to 
listener instance of class {0}
 standardContext.loadOnStartup.loadException=Servlet [{1}] in web application 
[{0}] threw load() exception
@@ -127,6 +131,7 @@ standardContext.loginConfig.loginPage=Fo
 standardContext.loginConfig.loginWarning=WARNING: Form login page {0} must 
start with a ''/'' in Servlet 2.4
 standardContext.loginConfig.required=LoginConfig cannot be null
 standardContext.manager=Configured a manager of class [{0}]
+standardContext.managerFail=The session manager failed to start
 standardContext.namingResource.init.fail=Failed to init new naming resources
 standardContext.namingResource.destroy.fail=Failed to destroy old naming 
resources
 standardContext.noResourceJar=Resource JARs are not supported. The JAR found 
at [{0}] will not be used to provide static content for context with name [{1}]
@@ -141,10 +146,12 @@ standardContext.predestroy.duplicate=Dup
 standardContext.predestroy.required=Both fully qualified class name and method 
name are required
 standardContext.reloadingCompleted=Reloading Context with name [{0}] is 
completed
 standardContext.reloadingStarted=Reloading Context with name [{0}] has started
+standardContext.resourcesInit=Error initializing static Resources
 standardContext.resourcesStart=Error starting static Resources
 standardContext.sciFail=Error during ServletContainerInitializer processing
 standardContext.securityConstraint.mixHttpMethod=It is not permitted to mix 
<http-method> and <http-method-omission> in the same web resource collection
 standardContext.securityConstraint.pattern=Invalid <url-pattern> {0} in 
security constraint
+standardContext.servletFail=One or more Servlets failed to load on startup. 
Full details will be found in the appropriate container log file
 standardContext.servletMap.name=Servlet mapping specifies an unknown servlet 
name {0}
 standardContext.servletMap.pattern=Invalid <url-pattern> {0} in servlet mapping
 standardContext.startFailed=Context [{0}] startup failed due to previous errors

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?rev=1675486&r1=1675485&r2=1675486&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Wed Apr 22 
20:05:02 2015
@@ -4963,7 +4963,7 @@ public class StandardContext extends Con
             try {
                 setResources(new StandardRoot(this));
             } catch (IllegalArgumentException e) {
-                log.error("Error initializing resources: " + e.getMessage());
+                log.error(sm.getString("standardContext.resourcesInit"), e);
                 ok = false;
             }
         }
@@ -4989,7 +4989,7 @@ public class StandardContext extends Con
             dependencyCheck = ExtensionValidator.validateApplication
                 (getResources(), this);
         } catch (IOException ioe) {
-            log.error("Error in dependencyCheck", ioe);
+            
log.error(sm.getString("standardContext.extensionValidationError"), ioe);
             dependencyCheck = false;
         }
 
@@ -5115,7 +5115,7 @@ public class StandardContext extends Con
             }
 
             if (!getConfigured()) {
-                log.error( "Error getConfigured");
+                log.error(sm.getString("standardContext.configurationFail"));
                 ok = false;
             }
 
@@ -5164,7 +5164,7 @@ public class StandardContext extends Con
             // Configure and call application event listeners
             if (ok) {
                 if (!listenerStart()) {
-                    log.error( "Error listenerStart");
+                    log.error(sm.getString("standardContext.listenerFail"));
                     ok = false;
                 }
             }
@@ -5183,14 +5183,14 @@ public class StandardContext extends Con
                     ((Lifecycle) manager).start();
                 }
             } catch(Exception e) {
-                log.error("Error manager.start()", e);
+                log.error(sm.getString("standardContext.managerFail"), e);
                 ok = false;
             }
 
             // Configure and call application filters
             if (ok) {
                 if (!filterStart()) {
-                    log.error("Error filterStart");
+                    log.error(sm.getString("standardContext.filterFail"));
                     ok = false;
                 }
             }
@@ -5198,7 +5198,7 @@ public class StandardContext extends Con
             // Load and initialize all "load on startup" servlets
             if (ok) {
                 if (!loadOnStartup(findChildren())){
-                    log.error("Error loadOnStartup");
+                    log.error(sm.getString("standardContext.servletFail"));
                     ok = false;
                 }
             }



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

Reply via email to