summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/binding-ws-axis2/src/main
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-04-15 21:48:20 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-04-15 21:48:20 +0000
commit052004e40e67c597eab2950a35486d184d75c396 (patch)
treedd0a3092dfef7a017e0e93600243945cbfb202a2 /java/sca/modules/binding-ws-axis2/src/main
parent4d48ced2155f34e3ce49f3ee68f8ec3c40a18fc1 (diff)
Make sure the class is returned
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@765382 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/binding-ws-axis2/src/main')
-rw-r--r--java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java b/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java
index 5273921688..6846d61c5b 100644
--- a/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java
+++ b/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java
@@ -190,7 +190,7 @@ public class Axis2ServiceProvider {
protected Class<?> findClass(String className) throws ClassNotFoundException {
for (ClassLoader parent : classLoaders) {
try {
- parent.loadClass(className);
+ return parent.loadClass(className);
} catch (ClassNotFoundException e) {
continue;
}
@@ -248,7 +248,10 @@ public class Axis2ServiceProvider {
ClassLoader cl2 =
modelFactories.getFactory(DocumentBuilderFactory.class).getClass().getClassLoader();
ClassLoader tccl = Thread.currentThread().getContextClassLoader();
- ClassLoader newTccl = new MultiParentClassLoader(tccl, new ClassLoader[] {cl1, cl2});
+ ClassLoader newTccl = tccl;
+ if (cl1 != tccl || cl2 != tccl) {
+ newTccl = new MultiParentClassLoader(null, new ClassLoader[] {cl1, cl2});
+ }
if (newTccl != null && newTccl != tccl) {
Thread.currentThread().setContextClassLoader(newTccl);
}