Author: heiko.braun(a)jboss.com
Date: 2008-06-12 14:52:50 -0400 (Thu, 12 Jun 2008)
New Revision: 7508
Modified:
stack/metro/trunk/modules/client/src/main/java/org/jboss/wsf/stack/metro/tools/MetroProviderImpl.java
Log:
Respect classloader hierarchy when building classpath
Modified:
stack/metro/trunk/modules/client/src/main/java/org/jboss/wsf/stack/metro/tools/MetroProviderImpl.java
===================================================================
---
stack/metro/trunk/modules/client/src/main/java/org/jboss/wsf/stack/metro/tools/MetroProviderImpl.java 2008-06-12
16:23:10 UTC (rev 7507)
+++
stack/metro/trunk/modules/client/src/main/java/org/jboss/wsf/stack/metro/tools/MetroProviderImpl.java 2008-06-12
18:52:50 UTC (rev 7508)
@@ -22,6 +22,7 @@
package org.jboss.wsf.stack.metro.tools;
import org.jboss.wsf.spi.tools.WSContractProvider;
+import org.apache.tools.ant.taskdefs.Classloader;
import java.io.File;
import java.io.PrintStream;
@@ -163,18 +164,11 @@
}
// --classpath
- if(loader instanceof URLClassLoader)
+ String cp = buildClasspathString(loader);
+ if(cp!=null)
{
- StringBuilder builder = new StringBuilder();
- URLClassLoader urlLoader = (URLClassLoader)loader;
- for(URL url : urlLoader.getURLs())
- {
- builder.append(url.getPath());
- builder.append(File.pathSeparator);
- }
-
args.add("-classpath");
- args.add(builder.toString());
+ args.add(cp);
}
// the SEI
@@ -194,5 +188,30 @@
}
}
+ private String buildClasspathString(ClassLoader cl)
+ {
+ String cp = null;
+ if(cl instanceof URLClassLoader)
+ {
+ StringBuilder builder = new StringBuilder();
+ URLClassLoader urlLoader = (URLClassLoader)cl;
+ for(URL url : urlLoader.getURLs())
+ {
+ builder.append(url.getPath());
+ builder.append(File.pathSeparator);
+ }
+
+ if(cl.getParent()!=null)
+ {
+ String parentPath = buildClasspathString(cl.getParent());
+ if(parentPath!=null) builder.append(parentPath);
+ }
+
+ cp = builder.toString();
+ }
+
+ return cp;
+ }
+
}
Show replies by date