Author: alessio.soldano(a)jboss.com
Date: 2010-02-05 13:06:49 -0500 (Fri, 05 Feb 2010)
New Revision: 11542
Modified:
common/branches/jaxrpc-cxf/src/main/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java
Log:
[JBWS-2895] Use TCCL instead when looking for the jbossws entity prop file
Modified:
common/branches/jaxrpc-cxf/src/main/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java
===================================================================
---
common/branches/jaxrpc-cxf/src/main/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java 2010-02-05
12:43:27 UTC (rev 11541)
+++
common/branches/jaxrpc-cxf/src/main/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java 2010-02-05
18:06:49 UTC (rev 11542)
@@ -66,7 +66,7 @@
super();
Properties props = null;
- ClassLoader loader = this.getClass().getClassLoader();
+ ClassLoader loader = Thread.currentThread().getContextClassLoader(); //TODO Use
SecurityAction!!
Map<String, Properties> map = propertiesMap.get(loader);
if (map != null && map.containsKey(entitiesResource))
{
@@ -80,7 +80,7 @@
propertiesMap.put(loader, map);
}
// load entities
- props = loadEntitiesMappingFromClasspath(entitiesResource);
+ props = loadEntitiesMappingFromClasspath(entitiesResource, loader);
if (props.size() == 0)
throw new IllegalArgumentException("No entities mapping defined in
resource file: " + entitiesResource);
map.put(entitiesResource, props);
@@ -97,13 +97,13 @@
}
}
- private Properties loadEntitiesMappingFromClasspath(final String entitiesResource)
+ private Properties loadEntitiesMappingFromClasspath(final String entitiesResource,
final ClassLoader classLoader)
{
return AccessController.doPrivileged(new PrivilegedAction<Properties>()
{
public Properties run()
{
- InputStream is =
this.getClass().getClassLoader().getResourceAsStream(entitiesResource);
+ InputStream is = classLoader.getResourceAsStream(entitiesResource);
// get stream
if (is == null)
throw new IllegalArgumentException("Resource " +
entitiesResource + " not found");