jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1050551 - /jackrabbit/trunk/jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/RepositoryStartupServlet.java
Date Sat, 18 Dec 2010 00:32:07 GMT
Author: jukka
Date: Sat Dec 18 00:32:07 2010
New Revision: 1050551

URL: http://svn.apache.org/viewvc?rev=1050551&view=rev
Log:
JCR-2850: RMI problems prevent proper startup of the Jackrabbit webapp

Catch all RMI exceptions and just log warnings for them.

Modified:
    jackrabbit/trunk/jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/RepositoryStartupServlet.java

Modified: jackrabbit/trunk/jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/RepositoryStartupServlet.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/RepositoryStartupServlet.java?rev=1050551&r1=1050550&r2=1050551&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/RepositoryStartupServlet.java
(original)
+++ jackrabbit/trunk/jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/RepositoryStartupServlet.java
Sat Dec 18 00:32:07 2010
@@ -483,7 +483,7 @@ public class RepositoryStartupServlet ex
      * the repository with an RMI registry.
      * @throws ServletException if an error occurs.
      */
-    private void registerRMI() throws ServletException {
+    private void registerRMI() {
         RMIConfig rc = config.getRmiConfig();
         if (!rc.isValid() || !rc.enabled()) {
             return;
@@ -492,16 +492,16 @@ public class RepositoryStartupServlet ex
         // try to create remote repository
         Remote remote;
         try {
-            Class clazz = Class.forName(getRemoteFactoryDelegaterClass());
+            Class<?> clazz = Class.forName(getRemoteFactoryDelegaterClass());
             RemoteFactoryDelegater rmf = (RemoteFactoryDelegater) clazz.newInstance();
             remote = rmf.createRemoteRepository(repository);
         } catch (RemoteException e) {
-            log.error("Unable to create RMI repository.", e);
-            throw new ServletExceptionWithCause("Unable to create remote repository.", e);
+            log.warn("Unable to create RMI repository.", e);
+            return;
         } catch (Throwable t) {
-            log.error("Unable to create RMI repository.", t);
-            throw new ServletExceptionWithCause(
-                    "Unable to create RMI repository. jcr-rmi.jar might be missing.", t);
+            log.warn("Unable to create RMI repository."
+                    + " The jcr-rmi jar might be missing.", t);
+            return;
         }
 
         try {
@@ -551,7 +551,7 @@ public class RepositoryStartupServlet ex
                 try {
                     reg = LocateRegistry.getRegistry(rc.getRmiHost(), rc.rmiPort());
                 } catch (RemoteException re) {
-                    log.error("Cannot create the reference to the registry at "
+                    log.warn("Cannot create the reference to the registry at "
                             + rc.getRmiHost() + ":" + rc.getRmiPort(), re);
                 }
             }
@@ -569,13 +569,10 @@ public class RepositoryStartupServlet ex
             } else {
                 log.info("RMI registry missing, cannot bind repository via RMI");
             }
-
         } catch (RemoteException e) {
-            throw new ServletExceptionWithCause(
-                    "Unable to bind repository via RMI: " + rc.getRmiUri(), e);
+            log.warn("Unable to bind repository via RMI: " + rc.getRmiUri(), e);
         } catch (AlreadyBoundException e) {
-            throw new ServletExceptionWithCause(
-                    "Unable to bind repository via RMI: " + rc.getRmiUri(), e);
+            log.warn("Unable to bind repository via RMI: " + rc.getRmiUri(), e);
         }
     }
 



Mime
View raw message