jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r354477 - in /incubator/jackrabbit/trunk/contrib/jcr-server: webapp/src/java/org/apache/jackrabbit/j2ee/ webdav/src/java/org/apache/jackrabbit/webdav/util/
Date Tue, 06 Dec 2005 17:15:56 GMT
Author: angela
Date: Tue Dec  6 09:15:45 2005
New Revision: 354477

URL: http://svn.apache.org/viewcvs?rev=354477&view=rev
Log:
- ignoring empty jndi init-params
- forcing http-date to Locale.en

Modified:
    incubator/jackrabbit/trunk/contrib/jcr-server/webapp/src/java/org/apache/jackrabbit/j2ee/RepositoryAccessServlet.java
    incubator/jackrabbit/trunk/contrib/jcr-server/webapp/src/java/org/apache/jackrabbit/j2ee/RepositoryStartupServlet.java
    incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/util/HttpDateFormat.java

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/webapp/src/java/org/apache/jackrabbit/j2ee/RepositoryAccessServlet.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/webapp/src/java/org/apache/jackrabbit/j2ee/RepositoryAccessServlet.java?rev=354477&r1=354476&r2=354477&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/webapp/src/java/org/apache/jackrabbit/j2ee/RepositoryAccessServlet.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/webapp/src/java/org/apache/jackrabbit/j2ee/RepositoryAccessServlet.java
Tue Dec  6 09:15:45 2005
@@ -37,16 +37,24 @@
  */
 public class RepositoryAccessServlet extends HttpServlet {
 
-    /** default logger */
+    /**
+     * default logger
+     */
     private static final Logger log = Logger.getLogger(RepositoryAccessServlet.class);
 
-    /** the 'repository-name' init parameter */
+    /**
+     * the 'repository-name' init parameter
+     */
     public final static String INIT_PARAM_REPOSITORY_NAME = "repository-name";
 
-    /** the 'rmi-uri' init parameter */
+    /**
+     * the 'rmi-uri' init parameter
+     */
     public final static String INIT_PARAM_RMI_URI = "rmi-uri";
 
-    /** the 'missing-auth-mapping' init parameter */
+    /**
+     * the 'missing-auth-mapping' init parameter
+     */
     //public final static String INIT_PARAM_MISSING_AUTH_MAPPING = "missing-auth-mapping";
 
     private static final String CTX_ATTR_REPOSITORY = "jcr.repository";
@@ -66,8 +74,8 @@
 	log.info("RepositoryAccessServlet initializing...");
         // fetching the name
         String repositoryName = getServletConfig().getInitParameter(INIT_PARAM_REPOSITORY_NAME);
-        if (repositoryName==null) {
-            repositoryName="default";
+        if (repositoryName == null) {
+            repositoryName = "default";
         }
         getServletContext().setAttribute(CTX_ATTR_REPOSITORY_NAME, repositoryName);
 
@@ -88,8 +96,13 @@
 	    while (names.hasMoreElements()) {
 		String name = (String) names.nextElement();
 		if (name.startsWith("java.naming.")) {
-		    env.put(name, getServletConfig().getInitParameter(name));
-		    log.info("  adding property to JNDI environment: " + name + "=" + env.getProperty(name));
+                    String initParam = getServletConfig().getInitParameter(name);
+                    if (initParam.equals("")) {
+                        log.info("  ignoring empty JNDI init param: " + name);
+                    } else {
+                        env.put(name, initParam);
+                        log.info("  adding property to JNDI environment: " + name + "=" +
initParam);
+                    }
 		}
 	    }
 	    return new InitialContext(env);
@@ -119,7 +132,7 @@
             log.info("Acquired repository via JNDI.");
             return r;
         } catch (NamingException e) {
-            log.error("Error while retrieving repository using JNDI (name=" + repositoryName
+"): " + e);
+            log.error("Error while retrieving repository using JNDI (name=" + repositoryName
+ "): " + e);
             return null;
         }
     }

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/webapp/src/java/org/apache/jackrabbit/j2ee/RepositoryStartupServlet.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/webapp/src/java/org/apache/jackrabbit/j2ee/RepositoryStartupServlet.java?rev=354477&r1=354476&r2=354477&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/webapp/src/java/org/apache/jackrabbit/j2ee/RepositoryStartupServlet.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/webapp/src/java/org/apache/jackrabbit/j2ee/RepositoryStartupServlet.java
Tue Dec  6 09:15:45 2005
@@ -191,26 +191,30 @@
 
     /**
      * Registers the repository in the JNDI context
-     * @throws ServletException
      */
-    private void registerJNDI() throws ServletException {
+    private void registerJNDI() {
 	// registering via jndi
 	Properties env = new Properties();
 	Enumeration names = getServletConfig().getInitParameterNames();
 	while (names.hasMoreElements()) {
 	    String name = (String) names.nextElement();
 	    if (name.startsWith("java.naming.")) {
-		env.put(name, getServletConfig().getInitParameter(name));
-		log.info("  adding property to JNDI environment: " + name + "=" + env.getProperty(name));
+                String initParam = getServletConfig().getInitParameter(name);
+                if (initParam.equals("")) {
+                    log.info("  ignoring empty JNDI init param: " + name);
+                } else {
+                    env.put(name, initParam);
+                    log.info("  adding property to JNDI environment: " + name + "=" + initParam);
+                }
 	    }
 	}
 	try {
 	    jndiContext = new InitialContext(env);
 	    jndiContext.bind(repositoryName, repository);
+            log.info("Repository bound to JNDI with name: " + repositoryName);
 	} catch (NamingException e) {
-	    throw new ServletException(e);
+            log.error("Unable to bind repository using JNDI: " + e, e);
 	}
-	log.info("Repository bound to JNDI with name: " + repositoryName);
     }
 
     /**
@@ -228,9 +232,8 @@
 
     /**
      * Registers the repositroy to the RMI registry
-     * @throws ServletException
      */
-    private void registerRMI() throws ServletException {
+    private void registerRMI() {
 	// check registering via RMI
 	String rmiPortStr = getServletConfig().getInitParameter(INIT_PARAM_RMI_PORT);
         String rmiHost = getServletConfig().getInitParameter(INIT_PARAM_RMI_HOST);
@@ -257,7 +260,8 @@
 		RemoteFactoryDelegater rmf = (RemoteFactoryDelegater) clazz.newInstance();
 		remote = rmf.createRemoteRepository(repository);
 	    } catch (RemoteException e) {
-		throw new ServletException("Unable to create remote repository: " + e.toString(), e);
+            log.error("Unable to create remote repository: " + e, e);
+            return;
 	    } catch (NoClassDefFoundError e) {
 		log.warn("Unable to create RMI repository. jcr-rmi.jar might be missing.: " + e.toString());
 		return;
@@ -281,11 +285,11 @@
 
 		log.info("Repository bound via RMI with name: " + rmiURI);
 	    } catch (MalformedURLException e) {
-		throw new ServletException("Unable to bind repository via RMI: " + e.toString(), e);
+            log.error("Unable to bind repository via RMI: " + e, e);
 	    } catch (RemoteException e) {
-		throw new ServletException("Unable to bind repository via RMI: " + e.toString(), e);
+            log.error("Unable to bind repository via RMI: " + e, e);
 	    } catch (AlreadyBoundException e) {
-		throw new ServletException("Unable to bind repository via RMI: " + e.toString(), e);
+            log.error("Unable to bind repository via RMI: " + e, e);
 	    }
 	}
 

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/util/HttpDateFormat.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/util/HttpDateFormat.java?rev=354477&r1=354476&r2=354477&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/util/HttpDateFormat.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/util/HttpDateFormat.java
Tue Dec  6 09:15:45 2005
@@ -15,10 +15,7 @@
  */
 package org.apache.jackrabbit.webdav.util;
 
-import org.apache.log4j.Logger;
-
 import java.text.SimpleDateFormat;
-import java.text.DateFormatSymbols;
 import java.util.Locale;
 import java.util.TimeZone;
 
@@ -27,26 +24,11 @@
  */
 public class HttpDateFormat extends SimpleDateFormat {
 
-    private static Logger log = Logger.getLogger(HttpDateFormat.class);
     private static final TimeZone GMT_TIMEZONE = TimeZone.getTimeZone("GMT");
 
-    public HttpDateFormat() {
-        super();
-        super.setTimeZone(GMT_TIMEZONE);
-    }
-
     public HttpDateFormat(String pattern) {
-        super(pattern);
+        super(pattern, Locale.ENGLISH);
         super.setTimeZone(GMT_TIMEZONE);
     }
 
-    public HttpDateFormat(String pattern, DateFormatSymbols formatSymbols) {
-        super(pattern, formatSymbols);
-        super.setTimeZone(GMT_TIMEZONE);
-    }
-
-    public HttpDateFormat(String pattern, Locale locale) {
-        super(pattern, locale);
-        super.setTimeZone(GMT_TIMEZONE);
-    }
 }



Mime
View raw message