You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2018/11/29 20:36:54 UTC

svn commit: r1847762 - in /tomcat/trunk/java/org/apache/catalina/startup: Catalina.java LocalStrings.properties

Author: remm
Date: Thu Nov 29 20:36:53 2018
New Revision: 1847762

URL: http://svn.apache.org/viewvc?rev=1847762&view=rev
Log:
More cleanups and strings for Catalina

Modified:
    tomcat/trunk/java/org/apache/catalina/startup/Catalina.java
    tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties

Modified: tomcat/trunk/java/org/apache/catalina/startup/Catalina.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/Catalina.java?rev=1847762&r1=1847761&r2=1847762&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/Catalina.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/Catalina.java Thu Nov 29 20:36:53 2018
@@ -494,7 +494,7 @@ public class Catalina {
                 digester.push(this);
                 digester.parse(is);
             } catch (Exception e) {
-                log.error("Catalina.stop: ", e);
+                log.error(sm.getString("catalina.stopError"), e);
                 System.exit(1);
             }
         } else {
@@ -502,7 +502,7 @@ public class Catalina {
             try {
                 s.stop();
             } catch (LifecycleException e) {
-                log.error("Catalina.stop: ", e);
+                log.error(sm.getString("catalina.stopError"), e);
             }
             return;
         }
@@ -521,10 +521,10 @@ public class Catalina {
                 log.error(sm.getString("catalina.stopServer.connectException", s.getAddress(),
                         String.valueOf(s.getPortWithOffset()), String.valueOf(s.getPort()),
                         String.valueOf(s.getPortOffset())));
-                log.error("Catalina.stop: ", ce);
+                log.error(sm.getString("catalina.stopError"), ce);
                 System.exit(1);
             } catch (IOException e) {
-                log.error("Catalina.stop: ", e);
+                log.error(sm.getString("catalina.stopError"), e);
                 System.exit(1);
             }
         } else {
@@ -566,11 +566,11 @@ public class Catalina {
             digester.parse(inputSource);
         } catch (Exception e) {
             if  (file == null) {
-                log.warn(sm.getString("catalina.configFail", getConfigFile() + "] or [server-embed.xml]"), e);
+                log.warn(sm.getString("catalina.configFail", getConfigFile() + "] or [server-embed.xml"), e);
             } else {
                 log.warn(sm.getString("catalina.configFail", file.getAbsolutePath()), e);
                 if (file.exists() && !file.canRead()) {
-                    log.warn("Permissions incorrect, read permission is not allowed on the file.");
+                    log.warn(sm.getString("catalina.incorrectPermissions"));
                 }
             }
             return;
@@ -590,13 +590,13 @@ public class Catalina {
             if (Boolean.getBoolean("org.apache.catalina.startup.EXIT_ON_INIT_FAILURE")) {
                 throw new java.lang.Error(e);
             } else {
-                log.error("Catalina.start", e);
+                log.error(sm.getString("catalina.initError"), e);
             }
         }
 
         long t2 = System.nanoTime();
         if(log.isInfoEnabled()) {
-            log.info("Initialization processed in " + ((t2 - t1) / 1000000) + " ms");
+            log.info(sm.getString("catalina.init", ((t2 - t1) / 1000000)));
         }
     }
 
@@ -711,7 +711,7 @@ public class Catalina {
                 s.destroy();
             }
         } catch (LifecycleException e) {
-            log.error("Catalina.stop", e);
+            log.error(sm.getString("catalina.stopError"), e);
         }
 
     }
@@ -732,11 +732,7 @@ public class Catalina {
      */
     protected void usage() {
 
-        System.out.println
-            ("usage: java org.apache.catalina.startup.Catalina"
-             + " [ -config {pathname} ]"
-             + " [ -nonaming ] "
-             + " { -help | start | stop }");
+        System.out.println(sm.getString("catalina.usage"));
 
     }
 
@@ -759,7 +755,7 @@ public class Catalina {
     protected void initNaming() {
         // Setting additional variables
         if (!useNaming) {
-            log.info( "Catalina naming disabled");
+            log.info(sm.getString("catalina.noNatming"));
             System.setProperty("catalina.useNaming", "false");
         } else {
             System.setProperty("catalina.useNaming", "true");
@@ -780,7 +776,7 @@ public class Catalina {
                     (javax.naming.Context.INITIAL_CONTEXT_FACTORY,
                      "org.apache.naming.java.javaURLContextFactory");
             } else {
-                log.debug( "INITIAL_CONTEXT_FACTORY already set " + value );
+                log.debug("INITIAL_CONTEXT_FACTORY already set " + value );
             }
         }
     }

Modified: tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties?rev=1847762&r1=1847761&r2=1847762&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties [UTF-8] (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties [UTF-8] Thu Nov 29 20:36:53 2018
@@ -14,13 +14,19 @@
 # limitations under the License.
 
 catalina.configFail=Unable to load server configuration from [{0}]
+catalina.incorrectPermissions=Permissions incorrect, read permission is not allowed on the file
+catalina.init=Server initialization in [{0}] milliseconds
+catalina.initError=Error initializing Catalina
 catalina.noCluster=Cluster RuleSet not found due to [{0}]. Cluster configuration disabled.
+catalina.noNatming=Naming environment is disabled
 catalina.noServer=Cannot start server, server instance is not configured
 catalina.serverStartFail=The required Server component failed to start so Tomcat is unable to start.
 catalina.shutdownHookFail=The shutdown hook experienced an error while trying to stop the server
 catalina.startup=Server startup in [{0}] milliseconds
+catalina.stopError=Error stopping Catalina
 catalina.stopServer=No shutdown port configured. Shut down server through OS signal. Server not shut down.
 catalina.stopServer.connectException=Could not contact [{0}:{1}] (base port [{2}] and offset [{3}]). Tomcat may not be running.
+catalina.usage=usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { -help | start | stop }
 
 catalinaConfigurationSource.cannotObtainURL=Cannot obtain URL for the relative path [{0}]. Check that catalina.base is set.
 



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