Author: fmui
Date: Mon Jan 28 12:59:38 2013
New Revision: 1439386

URL: http://svn.apache.org/viewvc?rev=1439386&view=rev
Log:
added better class loading control

Added:
    
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/ClassLoaderUtil.java
   (with props)
Modified:
    
chemistry/opencmis/trunk/chemistry-opencmis-bridge/chemistry-opencmis-bridge/src/main/java/org/apache/chemistry/opencmis/bridge/AbstractBridgeServiceFactory.java
    
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/cache/impl/CacheImpl.java
    
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/CmisBindingImpl.java
    
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/CmisBindingsHelper.java
    
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/CmisLocalSpi.java
    
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/CmisWebServicesSpi.java
    
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java
    
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/CmisRepositoryContextListener.java
    
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-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/AbstractRunner.java

Modified: 
chemistry/opencmis/trunk/chemistry-opencmis-bridge/chemistry-opencmis-bridge/src/main/java/org/apache/chemistry/opencmis/bridge/AbstractBridgeServiceFactory.java
URL: 
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-bridge/chemistry-opencmis-bridge/src/main/java/org/apache/chemistry/opencmis/bridge/AbstractBridgeServiceFactory.java?rev=1439386&r1=1439385&r2=1439386&view=diff
==============================================================================
--- 
chemistry/opencmis/trunk/chemistry-opencmis-bridge/chemistry-opencmis-bridge/src/main/java/org/apache/chemistry/opencmis/bridge/AbstractBridgeServiceFactory.java
 (original)
+++ 
chemistry/opencmis/trunk/chemistry-opencmis-bridge/chemistry-opencmis-bridge/src/main/java/org/apache/chemistry/opencmis/bridge/AbstractBridgeServiceFactory.java
 Mon Jan 28 12:59:38 2013
@@ -22,6 +22,7 @@ import java.io.File;
 import java.math.BigInteger;
 import java.util.Map;
 
+import org.apache.chemistry.opencmis.commons.impl.ClassLoaderUtil;
 import 
org.apache.chemistry.opencmis.commons.impl.server.AbstractServiceFactory;
 import org.apache.chemistry.opencmis.commons.server.CallContext;
 import org.apache.chemistry.opencmis.commons.server.CmisService;
@@ -87,7 +88,7 @@ public abstract class AbstractBridgeServ
         }
 
         try {
-            serviceClass = Class.forName(className);
+            serviceClass = ClassLoaderUtil.loadClass(className);
         } catch (ClassNotFoundException e) {
             throw new RuntimeException("Service class name cannot be found: " 
+ e.getMessage(), e);
         }

Modified: 
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/cache/impl/CacheImpl.java
URL: 
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/cache/impl/CacheImpl.java?rev=1439386&r1=1439385&r2=1439386&view=diff
==============================================================================
--- 
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/cache/impl/CacheImpl.java
 (original)
+++ 
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/cache/impl/CacheImpl.java
 Mon Jan 28 12:59:38 2013
@@ -26,6 +26,7 @@ import java.util.concurrent.locks.Reentr
 
 import org.apache.chemistry.opencmis.client.bindings.cache.Cache;
 import org.apache.chemistry.opencmis.client.bindings.cache.CacheLevel;
+import org.apache.chemistry.opencmis.commons.impl.ClassLoaderUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -96,7 +97,7 @@ public class CacheImpl implements Cache 
         // get the class
         Class<?> clazz;
         try {
-            clazz = Class.forName(className);
+            clazz = ClassLoaderUtil.loadClass(className, 
this.getClass().getClassLoader());
         } catch (ClassNotFoundException e) {
             throw new IllegalArgumentException("Class '" + className + "' not 
found!", e);
         }

Modified: 
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/CmisBindingImpl.java
URL: 
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/CmisBindingImpl.java?rev=1439386&r1=1439385&r2=1439386&view=diff
==============================================================================
--- 
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/CmisBindingImpl.java
 (original)
+++ 
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/CmisBindingImpl.java
 Mon Jan 28 12:59:38 2013
@@ -25,6 +25,7 @@ import org.apache.chemistry.opencmis.cli
 import org.apache.chemistry.opencmis.client.bindings.spi.CmisSpi;
 import 
org.apache.chemistry.opencmis.client.bindings.spi.SessionAwareAuthenticationProvider;
 import org.apache.chemistry.opencmis.commons.SessionParameter;
+import org.apache.chemistry.opencmis.commons.impl.ClassLoaderUtil;
 import 
org.apache.chemistry.opencmis.commons.impl.dataobjects.BindingsObjectFactoryImpl;
 import org.apache.chemistry.opencmis.commons.spi.AclService;
 import org.apache.chemistry.opencmis.commons.spi.AuthenticationProvider;
@@ -90,7 +91,7 @@ public class CmisBindingImpl implements 
                 Object authProviderObj = null;
 
                 try {
-                    authProviderObj = 
Class.forName(authProviderClassName).newInstance();
+                    authProviderObj = 
ClassLoaderUtil.loadClass(authProviderClassName).newInstance();
                 } catch (Exception e) {
                     throw new IllegalArgumentException("Could not load 
authentication provider: " + e, e);
                 }

Modified: 
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/CmisBindingsHelper.java
URL: 
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/CmisBindingsHelper.java?rev=1439386&r1=1439385&r2=1439386&view=diff
==============================================================================
--- 
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/CmisBindingsHelper.java
 (original)
+++ 
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/CmisBindingsHelper.java
 Mon Jan 28 12:59:38 2013
@@ -26,6 +26,7 @@ import org.apache.chemistry.opencmis.cli
 import org.apache.chemistry.opencmis.commons.SessionParameter;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisBaseException;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
+import org.apache.chemistry.opencmis.commons.impl.ClassLoaderUtil;
 import org.apache.chemistry.opencmis.commons.spi.AuthenticationProvider;
 
 /**
@@ -75,7 +76,7 @@ public final class CmisBindingsHelper {
             // ok, we have to create it...
             try {
                 String spiName = (String) 
session.get(SessionParameter.BINDING_SPI_CLASS);
-                Constructor<?> c = 
Class.forName(spiName).getConstructor(BindingSession.class);
+                Constructor<?> c = 
ClassLoaderUtil.loadClass(spiName).getConstructor(BindingSession.class);
                 spi = (CmisSpi) c.newInstance(session);
             } catch (CmisBaseException e) {
                 throw e;
@@ -113,7 +114,7 @@ public final class CmisBindingsHelper {
             // ok, we have to create it...
             try {
                 String invokerName = (String) 
session.get(SessionParameter.HTTP_INVOKER_CLASS);
-                invoker = (HttpInvoker) 
Class.forName(invokerName).newInstance();
+                invoker = (HttpInvoker) 
ClassLoaderUtil.loadClass(invokerName).newInstance();
             } catch (CmisBaseException e) {
                 throw e;
             } catch (Exception e) {

Modified: 
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/CmisLocalSpi.java
URL: 
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/CmisLocalSpi.java?rev=1439386&r1=1439385&r2=1439386&view=diff
==============================================================================
--- 
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/CmisLocalSpi.java
 (original)
+++ 
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/CmisLocalSpi.java
 Mon Jan 28 12:59:38 2013
@@ -27,6 +27,7 @@ import org.apache.chemistry.opencmis.cli
 import org.apache.chemistry.opencmis.client.bindings.spi.CmisSpi;
 import org.apache.chemistry.opencmis.commons.SessionParameter;
 import 
org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException;
+import org.apache.chemistry.opencmis.commons.impl.ClassLoaderUtil;
 import org.apache.chemistry.opencmis.commons.server.CmisServiceFactory;
 import org.apache.chemistry.opencmis.commons.spi.AclService;
 import org.apache.chemistry.opencmis.commons.spi.DiscoveryService;
@@ -84,7 +85,7 @@ public class CmisLocalSpi implements Cmi
             }
 
             // create and initialize factory
-            factory = (CmisServiceFactory) 
Class.forName(serviceFactoryClassname).newInstance();
+            factory = (CmisServiceFactory) 
ClassLoaderUtil.loadClass(serviceFactoryClassname).newInstance();
             factory.init(parameters);
         } catch (Exception e) {
             throw new CmisConnectionException("Factory cannot be created: " + 
e.getMessage(), e);

Modified: 
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/CmisWebServicesSpi.java
URL: 
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/CmisWebServicesSpi.java?rev=1439386&r1=1439385&r2=1439386&view=diff
==============================================================================
--- 
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/CmisWebServicesSpi.java
 (original)
+++ 
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/CmisWebServicesSpi.java
 Mon Jan 28 12:59:38 2013
@@ -21,6 +21,7 @@ package org.apache.chemistry.opencmis.cl
 import org.apache.chemistry.opencmis.client.bindings.spi.BindingSession;
 import org.apache.chemistry.opencmis.client.bindings.spi.CmisSpi;
 import org.apache.chemistry.opencmis.commons.SessionParameter;
+import org.apache.chemistry.opencmis.commons.impl.ClassLoaderUtil;
 import org.apache.chemistry.opencmis.commons.spi.AclService;
 import org.apache.chemistry.opencmis.commons.spi.DiscoveryService;
 import org.apache.chemistry.opencmis.commons.spi.MultiFilingService;
@@ -67,7 +68,7 @@ public class CmisWebServicesSpi implemen
             Object portProviderObj = null;
 
             try {
-                portProviderObj = 
Class.forName(portProviderClass).newInstance();
+                portProviderObj = 
ClassLoaderUtil.loadClass(portProviderClass).newInstance();
             } catch (Exception e) {
                 throw new IllegalArgumentException("Could not load port 
provider: " + e, e);
             }

Modified: 
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java
URL: 
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java?rev=1439386&r1=1439385&r2=1439386&view=diff
==============================================================================
--- 
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java
 (original)
+++ 
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java
 Mon Jan 28 12:59:38 2013
@@ -73,6 +73,7 @@ import org.apache.chemistry.opencmis.com
 import 
org.apache.chemistry.opencmis.commons.exceptions.CmisConstraintException;
 import 
org.apache.chemistry.opencmis.commons.exceptions.CmisNotSupportedException;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
+import org.apache.chemistry.opencmis.commons.impl.ClassLoaderUtil;
 import 
org.apache.chemistry.opencmis.commons.impl.dataobjects.BulkUpdateObjectIdAndChangeTokenImpl;
 import org.apache.chemistry.opencmis.commons.spi.AclService;
 import org.apache.chemistry.opencmis.commons.spi.AuthenticationProvider;
@@ -207,7 +208,7 @@ public class SessionImpl implements Sess
             if (classname == null) {
                 objectFactoryClass = ObjectFactoryImpl.class;
             } else {
-                objectFactoryClass = Class.forName(classname);
+                objectFactoryClass = ClassLoaderUtil.loadClass(classname);
             }
 
             Object of = objectFactoryClass.newInstance();
@@ -231,7 +232,7 @@ public class SessionImpl implements Sess
             if (classname == null) {
                 cacheClass = CacheImpl.class;
             } else {
-                cacheClass = Class.forName(classname);
+                cacheClass = ClassLoaderUtil.loadClass(classname);
             }
 
             Object of = cacheClass.newInstance();

Added: 
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/ClassLoaderUtil.java
URL: 
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/ClassLoaderUtil.java?rev=1439386&view=auto
==============================================================================
--- 
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/ClassLoaderUtil.java
 (added)
+++ 
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/ClassLoaderUtil.java
 Mon Jan 28 12:59:38 2013
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.chemistry.opencmis.commons.impl;
+
+public class ClassLoaderUtil {
+
+    /**
+     * Loads a class. If the context class loader is set, it is used.
+     */
+    public static Class<?> loadClass(String className) throws 
ClassNotFoundException {
+        return loadClass(className, 
Thread.currentThread().getContextClassLoader());
+    }
+
+    /**
+     * Loads a class from the given class loader.
+     */
+    public static Class<?> loadClass(String className, ClassLoader 
classLoader) throws ClassNotFoundException {
+        if (classLoader == null) {
+            return Class.forName(className);
+        } else {
+            return Class.forName(className, true, classLoader);
+        }
+    }
+}

Propchange: 
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/ClassLoaderUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: 
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/CmisRepositoryContextListener.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/CmisRepositoryContextListener.java?rev=1439386&r1=1439385&r2=1439386&view=diff
==============================================================================
--- 
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/CmisRepositoryContextListener.java
 (original)
+++ 
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/CmisRepositoryContextListener.java
 Mon Jan 28 12:59:38 2013
@@ -28,6 +28,7 @@ import java.util.Properties;
 import javax.servlet.ServletContextEvent;
 import javax.servlet.ServletContextListener;
 
+import org.apache.chemistry.opencmis.commons.impl.ClassLoaderUtil;
 import org.apache.chemistry.opencmis.commons.server.CmisServiceFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -102,7 +103,7 @@ public class CmisRepositoryContextListen
         // create a factory instance
         Object object = null;
         try {
-            object = Class.forName(className).newInstance();
+            object = ClassLoaderUtil.loadClass(className).newInstance();
         } catch (Exception e) {
             LOG.warn("Could not create a services factory instance: " + e, e);
             return null;

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=1439386&r1=1439385&r2=1439386&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
 Mon Jan 28 12:59:38 2013
@@ -68,6 +68,7 @@ import org.apache.chemistry.opencmis.com
 import 
org.apache.chemistry.opencmis.commons.exceptions.CmisStreamNotSupportedException;
 import 
org.apache.chemistry.opencmis.commons.exceptions.CmisUpdateConflictException;
 import 
org.apache.chemistry.opencmis.commons.exceptions.CmisVersioningException;
+import org.apache.chemistry.opencmis.commons.impl.ClassLoaderUtil;
 import org.apache.chemistry.opencmis.commons.server.CallContext;
 import org.apache.chemistry.opencmis.commons.server.CmisService;
 import org.apache.chemistry.opencmis.commons.server.CmisServiceFactory;
@@ -113,7 +114,8 @@ public class CmisAtomPubServlet extends 
         String callContextHandlerClass = 
config.getInitParameter(PARAM_CALL_CONTEXT_HANDLER);
         if (callContextHandlerClass != null) {
             try {
-                callContextHandler = (CallContextHandler) 
Class.forName(callContextHandlerClass).newInstance();
+                callContextHandler = (CallContextHandler) 
ClassLoaderUtil.loadClass(callContextHandlerClass)
+                        .newInstance();
             } catch (Exception e) {
                 throw new ServletException("Could not load call context 
handler: " + e, e);
             }

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=1439386&r1=1439385&r2=1439386&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
 Mon Jan 28 12:59:38 2013
@@ -108,6 +108,7 @@ import org.apache.chemistry.opencmis.com
 import 
org.apache.chemistry.opencmis.commons.exceptions.CmisStreamNotSupportedException;
 import 
org.apache.chemistry.opencmis.commons.exceptions.CmisUpdateConflictException;
 import 
org.apache.chemistry.opencmis.commons.exceptions.CmisVersioningException;
+import org.apache.chemistry.opencmis.commons.impl.ClassLoaderUtil;
 import org.apache.chemistry.opencmis.commons.impl.Constants;
 import org.apache.chemistry.opencmis.commons.impl.json.JSONObject;
 import org.apache.chemistry.opencmis.commons.server.CallContext;
@@ -151,7 +152,8 @@ public class CmisBrowserBindingServlet e
         String callContextHandlerClass = 
config.getInitParameter(PARAM_CALL_CONTEXT_HANDLER);
         if (callContextHandlerClass != null) {
             try {
-                callContextHandler = (CallContextHandler) 
Class.forName(callContextHandlerClass).newInstance();
+                callContextHandler = (CallContextHandler) 
ClassLoaderUtil.loadClass(callContextHandlerClass)
+                        .newInstance();
             } catch (Exception e) {
                 throw new ServletException("Could not load call context 
handler: " + e, e);
             }

Modified: 
chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/AbstractRunner.java
URL: 
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/AbstractRunner.java?rev=1439386&r1=1439385&r2=1439386&view=diff
==============================================================================
--- 
chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/AbstractRunner.java
 (original)
+++ 
chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/AbstractRunner.java
 Mon Jan 28 12:59:38 2013
@@ -28,6 +28,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.chemistry.opencmis.commons.impl.ClassLoaderUtil;
 import org.apache.chemistry.opencmis.tck.CmisTest;
 import org.apache.chemistry.opencmis.tck.CmisTestGroup;
 import org.apache.chemistry.opencmis.tck.CmisTestProgressMonitor;
@@ -201,7 +202,7 @@ public abstract class AbstractRunner {
             return;
         }
 
-        Class<?> clazz = Class.forName(groupClass);
+        Class<?> clazz = ClassLoaderUtil.loadClass(groupClass);
         Object o = clazz.newInstance();
         CmisTestGroup group = null;
 


Reply via email to