Author: jboynes
Date: Tue Mar 14 13:31:05 2006
New Revision: 385895
URL: http://svn.apache.org/viewcvs?rev=385895&view=rev
Log:
set TCCL when loading application classes due to SDO issues
Modified:
incubator/tuscany/java/sca/container.java/src/main/java/org/apache/tuscany/container/java/loader/JavaImplementationLoader.java
Modified:
incubator/tuscany/java/sca/container.java/src/main/java/org/apache/tuscany/container/java/loader/JavaImplementationLoader.java
URL:
http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/container.java/src/main/java/org/apache/tuscany/container/java/loader/JavaImplementationLoader.java?rev=385895&r1=385894&r2=385895&view=diff
==============================================================================
---
incubator/tuscany/java/sca/container.java/src/main/java/org/apache/tuscany/container/java/loader/JavaImplementationLoader.java
(original)
+++
incubator/tuscany/java/sca/container.java/src/main/java/org/apache/tuscany/container/java/loader/JavaImplementationLoader.java
Tue Mar 14 13:31:05 2006
@@ -70,12 +70,16 @@
public JavaImplementation load(XMLStreamReader reader, ResourceLoader
resourceLoader) throws XMLStreamException, ConfigurationLoadException {
JavaImplementation javaImpl = factory.createJavaImplementation();
String typeName = reader.getAttributeValue(null, "class");
+ ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
try {
+
Thread.currentThread().setContextClassLoader(resourceLoader.getClassLoader());
// todo the type information should not require loading of an
application class, save until build time
Class<?> type = resourceLoader.loadClass(typeName);
javaImpl.setImplementationClass(type);
} catch (ClassNotFoundException e) {
throw (ConfigurationLoadException) new
ConfigurationLoadException(e.getMessage()).initCause(e);
+ } finally {
+ Thread.currentThread().setContextClassLoader(oldCL);
}
return javaImpl;
}