You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2009/02/12 19:58:37 UTC

svn commit: r743838 - /servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/SharedLibraryImpl.java

Author: gnodet
Date: Thu Feb 12 18:58:37 2009
New Revision: 743838

URL: http://svn.apache.org/viewvc?rev=743838&view=rev
Log:
SMX4NMR-81: Can not deploy a shared library with a class path item equals to '.'

Modified:
    servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/SharedLibraryImpl.java

Modified: servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/SharedLibraryImpl.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/SharedLibraryImpl.java?rev=743838&r1=743837&r2=743838&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/SharedLibraryImpl.java (original)
+++ servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/SharedLibraryImpl.java Thu Feb 12 18:58:37 2009
@@ -17,6 +17,8 @@
 package org.apache.servicemix.jbi.deployer.impl;
 
 import java.net.URL;
+import java.util.List;
+import java.util.ArrayList;
 
 import org.apache.servicemix.jbi.deployer.SharedLibrary;
 import org.apache.servicemix.jbi.deployer.descriptor.ClassPath;
@@ -58,16 +60,19 @@
             boolean parentFirst = library.isParentFirstClassLoaderDelegation();
             ClassPath cp = library.getSharedLibraryClassPath();
             String[] classPathNames = cp.getPathElements();
-            URL[] urls = new URL[classPathNames.length];
+            List<URL> urls = new ArrayList<URL>();
             for (int i = 0; i < classPathNames.length; i++) {
-                urls[i] = bundle.getResource(classPathNames[i]);
-                if (urls[i] == null) {
-                    throw new IllegalArgumentException("SharedLibrary classpath entry not found: '" +  classPathNames[i] + "'");
+                if (!".".equals(classPathNames[i])) {
+                    URL url = bundle.getResource(classPathNames[i]);
+                    if (url == null) {
+                        throw new IllegalArgumentException("SharedLibrary classpath entry not found: '" +  classPathNames[i] + "'");
+                    }
+                    urls.add(url);
                 }
             }
             classLoader = new MultiParentClassLoader(
                             library.getIdentification().getName(),
-                            urls,
+                            urls.toArray(new URL[urls.size()]),
                             parent,
                             !parentFirst,
                             new String[0],