Index: src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentImpl.java =================================================================== --- src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentImpl.java (revision 10006) +++ src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentImpl.java (working copy) @@ -28,6 +28,7 @@ import java.util.List; import org.jboss.logging.Logger; +import org.jboss.ws.core.utils.PathUtil; import org.jboss.wsf.spi.deployment.ArchiveDeployment; import org.jboss.wsf.spi.deployment.UnifiedVirtualFile; @@ -123,29 +124,38 @@ if (resourceURL == null && metadataFiles != null && !metadataFiles.isEmpty()) { UnifiedVirtualFile vfResource = null; - for (Iterator it = getMetadataFiles().iterator(); it.hasNext() && vfResource == null;) + for (UnifiedVirtualFile metadataFile : getMetadataFiles()) { - UnifiedVirtualFile uvf = it.next(); - URL wsdlUrl = uvf.toURL(); - String wsdlPath = wsdlUrl.getPath(); + URL metadataUrl = metadataFile.toURL(); + String wsdlPath = metadataUrl.getPath(); if (wsdlPath.startsWith("/")) wsdlPath = wsdlPath.substring(1); + + resourcePath = PathUtil.handleRelativePath(resourcePath); if (resourcePath.equals(wsdlPath)) { - vfResource = uvf; + vfResource = metadataFile; + break; } else { try { - vfResource = uvf.findChild(resourcePath); + UnifiedVirtualFile child = metadataFile.findChild(resourcePath); + if (child != null) + { + vfResource = child; + break; + } } catch (IOException e) { - log.debug("Cannot get " + resourcePath + " from " + uvf, e); + log.debug("Cannot get " + resourcePath + " from " + metadataFile, e); } } + } + if (vfResource == null) throw new IOException("Could not find " + resourcePath + " in the additional metadatafiles!");