chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1417997 - in /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl: atompub/ browser/ webservices/
Date Thu, 06 Dec 2012 16:49:10 GMT
Author: fmui
Date: Thu Dec  6 16:49:08 2012
New Revision: 1417997

URL: http://svn.apache.org/viewvc?rev=1417997&view=rev
Log:
Server: catching factory config problems

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/CmisAtomPubServlet.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/CmisWebServicesServlet.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/CmisAtomPubServlet.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/CmisAtomPubServlet.java?rev=1417997&r1=1417996&r2=1417997&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/CmisAtomPubServlet.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/CmisAtomPubServlet.java
Thu Dec  6 16:49:08 2012
@@ -121,6 +121,10 @@ public class CmisAtomPubServlet extends 
         CmisServiceFactory factory = (CmisServiceFactory) config.getServletContext().getAttribute(
                 CmisRepositoryContextListener.SERVICES_FACTORY);
 
+        if (factory == null) {
+            throw new CmisRuntimeException("Service factory not available! Configuration
problem?");
+        }
+
         tempDir = factory.getTempDirectory();
         memoryThreshold = factory.getMemoryThreshold();
         maxContentSize = factory.getMaxContentSize();

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.java?rev=1417997&r1=1417996&r2=1417997&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.java
Thu Dec  6 16:49:08 2012
@@ -161,6 +161,10 @@ public class CmisBrowserBindingServlet e
         CmisServiceFactory factory = (CmisServiceFactory) config.getServletContext().getAttribute(
                 CmisRepositoryContextListener.SERVICES_FACTORY);
 
+        if (factory == null) {
+            throw new CmisRuntimeException("Service factory not available! Configuration
problem?");
+        }
+
         tempDir = factory.getTempDirectory();
         memoryThreshold = factory.getMemoryThreshold();
         maxContentSize = factory.getMaxContentSize();

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/CmisWebServicesServlet.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/CmisWebServicesServlet.java?rev=1417997&r1=1417996&r2=1417997&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/CmisWebServicesServlet.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/CmisWebServicesServlet.java
Thu Dec  6 16:49:08 2012
@@ -21,6 +21,7 @@ package org.apache.chemistry.opencmis.se
 import javax.servlet.ServletConfig;
 import javax.xml.ws.WebServiceFeature;
 
+import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
 import org.apache.chemistry.opencmis.commons.server.CmisServiceFactory;
 import org.apache.chemistry.opencmis.server.impl.CmisRepositoryContextListener;
 
@@ -44,6 +45,10 @@ public class CmisWebServicesServlet exte
             CmisServiceFactory factory = (CmisServiceFactory) getServletContext().getAttribute(
                     CmisRepositoryContextListener.SERVICES_FACTORY);
 
+            if (factory == null) {
+                throw new CmisRuntimeException("Service factory not available! Configuration
problem?");
+            }
+
             // iterate of all adapters
             for (ServletAdapter adapter : delegate.adapters) {
                 WSFeatureList wsfl = adapter.getEndpoint().getBinding().getFeatures();



Mime
View raw message