jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r721191 - /jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/standalone/Main.java
Date Thu, 27 Nov 2008 14:46:44 GMT
Author: jukka
Date: Thu Nov 27 06:46:44 2008
New Revision: 721191

URL: http://svn.apache.org/viewvc?rev=721191&view=rev
Log:
JCR-1357: Create "quick start" developer bundles for model 1,2,3 deployment

Graceful handling of startup errors.

Modified:
    jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/standalone/Main.java

Modified: jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/standalone/Main.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/standalone/Main.java?rev=721191&r1=721190&r2=721191&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/standalone/Main.java
(original)
+++ jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/standalone/Main.java
Thu Nov 27 06:46:44 2008
@@ -19,6 +19,7 @@
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
+import java.net.BindException;
 import java.net.URL;
 
 import org.apache.commons.cli.CommandLine;
@@ -125,14 +126,21 @@
             prepareConnector();
             server.addConnector(connector);
             prepareShutdown();
-            server.start();
 
-            String host = connector.getHost();
-            if (host == null) {
-                host = "localhost";
+            try {
+                server.start();
+
+                String host = connector.getHost();
+                if (host == null) {
+                    host = "localhost";
+                }
+                message("Apache Jackrabbit is now running at "
+                        +"http://" + host + ":" + connector.getPort() + "/");
+            } catch (Throwable t) {
+                System.err.println(
+                        "Unable to start the server: " + t.getMessage());
+                System.exit(1);
             }
-            message("Apache Jackrabbit is now running at "
-                    +"http://" + host + ":" + connector.getPort() + "/");
         }
     }
 



Mime
View raw message