Author: darran.lofthouse(a)jboss.com
Date: 2007-01-12 06:16:16 -0500 (Fri, 12 Jan 2007)
New Revision: 1937
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigFactory.java
trunk/jbossws-tests/build.xml
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/jbws1121/JBWS1121TestCase.java
Log:
JBWS-1328 - Fix loading of security resources when deployed as ear to jboss-5.0.x
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigFactory.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigFactory.java 2007-01-12
06:19:37 UTC (rev 1936)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigFactory.java 2007-01-12
11:16:16 UTC (rev 1937)
@@ -4,6 +4,7 @@
import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
import java.io.IOException;
+import java.io.InputStream;
import java.net.URL;
/**
@@ -13,7 +14,8 @@
* Time: 16:17:02
* To change this template use File | Settings | File Templates.
*/
-public class WSSecurityConfigFactory {
+public class WSSecurityConfigFactory
+{
public static WSSecurityConfigFactory newInstance()
{
@@ -34,7 +36,8 @@
resource = "META-INF/" + resource;
}
- URL location = udi.classLoader.getResource(resource);
+ URL location = getResource(udi, resource);
+
if (location != null)
{
config = WSSecurityOMFactory.newInstance().parse(location);
@@ -42,14 +45,14 @@
// Get and set deployment path to the keystore file
if (config.getKeyStoreFile() != null)
{
- location = udi.classLoader.getResource(config.getKeyStoreFile());
+ location = getResource(udi, config.getKeyStoreFile());
if (location != null)
config.setKeyStoreURL(location);
}
if (config.getTrustStoreFile() != null)
{
- location = udi.classLoader.getResource(config.getTrustStoreFile());
+ location = getResource(udi, config.getTrustStoreFile());
if (location != null)
config.setTrustStoreURL(location);
}
@@ -58,4 +61,20 @@
return config;
}
+ private URL getResource(UnifiedDeploymentInfo udi, String resource)
+ {
+ try
+ {
+ URL url = udi.getMetaDataFileURL(resource);
+ InputStream inputStream = url.openStream();
+ inputStream.close();
+
+ return url;
+ }
+ catch (IOException e)
+ {
+ return null;
+ }
+ }
+
}
Modified: trunk/jbossws-tests/build.xml
===================================================================
--- trunk/jbossws-tests/build.xml 2007-01-12 06:19:37 UTC (rev 1936)
+++ trunk/jbossws-tests/build.xml 2007-01-12 11:16:16 UTC (rev 1937)
@@ -179,6 +179,7 @@
<pathelement
location="${integration.jboss50.dir}/output/lib/jbossws-jboss50-integration.jar"/>
<pathelement
location="${integration.jboss42.dir}/output/lib/jbossws-jboss42-integration.jar"/>
<pathelement
location="${integration.tomcat.dir}/output/lib/jbossws-tomcat-integration.jar"/>
+ <pathelement location="${thirdparty.dir}/commons-logging.jar"/>
<pathelement location="${thirdparty.dir}/log4j.jar"/>
<path refid="javac.classpath"/>
</path>
Modified:
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/jbws1121/JBWS1121TestCase.java
===================================================================
---
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/jbws1121/JBWS1121TestCase.java 2007-01-12
06:19:37 UTC (rev 1936)
+++
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/jbws1121/JBWS1121TestCase.java 2007-01-12
11:16:16 UTC (rev 1937)
@@ -50,7 +50,6 @@
return JBossWSTestSetup.newTestSetup(JBWS1121TestCase.class,
"jaxrpc-jbws1121.ear");
}
- /*
public void setUp() throws Exception
{
super.setUp();
@@ -61,13 +60,9 @@
port = (HelloWorld)service.getPort(HelloWorld.class);
}
}
- */
public void testCall() throws Exception
{
- System.out.println("FIXME: [JBWS-1328] Client security configuration not
loaded when client deployed with issolated classloader");
- if (true) return;
-
String response = port.echo("Hello");
assertEquals("Hello", response);
}