jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r890894 - /jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/Jcr2spiRepositoryFactory.java
Date Tue, 15 Dec 2009 17:25:46 GMT
Author: mduerig
Date: Tue Dec 15 17:25:46 2009
New Revision: 890894

URL: http://svn.apache.org/viewvc?rev=890894&view=rev
Log:
JCR-2441: Jcr2spiRepositoryFactory: make class loading more robust

Modified:
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/Jcr2spiRepositoryFactory.java

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/Jcr2spiRepositoryFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/Jcr2spiRepositoryFactory.java?rev=890894&r1=890893&r2=890894&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/Jcr2spiRepositoryFactory.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/Jcr2spiRepositoryFactory.java
Tue Dec 15 17:25:46 2009
@@ -186,8 +186,15 @@
             String serviceFactoryName = (String)serviceFactoryParam;
             log.debug("Found RepositoryServiceFactory class name {}", serviceFactoryName);
             try {
-                Class<?> serviceFactoryClass = Class.forName(serviceFactoryName, true,
-                            Thread.currentThread().getContextClassLoader());
+                Class<?> serviceFactoryClass;
+                try {
+                    serviceFactoryClass = Class.forName(serviceFactoryName, true,
+                                Thread.currentThread().getContextClassLoader());
+                }
+                catch (ClassNotFoundException e) {
+                    // Backup for OSGi
+                    serviceFactoryClass = Class.forName(serviceFactoryName);
+                }
 
                 Object serviceFactory = serviceFactoryClass.newInstance();
 



Mime
View raw message