Author: lukaszlenart Date: Thu Dec 20 09:25:40 2012 New Revision: 1424375 URL: http://svn.apache.org/viewvc?rev=1424375&view=rev Log: WW-3950 solves problem when there are two Convention based application deployed to JBoss 4.x
Modified: struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java Modified: struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java?rev=1424375&r1=1424374&r2=1424375&view=diff ============================================================================== --- struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java (original) +++ struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java Thu Dec 20 09:25:40 2012 @@ -401,18 +401,19 @@ public class PackageBasedActionConfigBui } private List<URL> readUrls() throws IOException { - List<URL> list = buildUrlSet().getUrls(); + List<URL> resourceUrls = new ArrayList<URL>(); // Usually the "classes" dir. ArrayList<URL> classesList = Collections.list(getClassLoaderInterface().getResources("")); for (URL url : classesList) { - list.addAll(fileManager.getAllPhysicalUrls(url)); + resourceUrls.addAll(fileManager.getAllPhysicalUrls(url)); } - return list; + return buildUrlSet(resourceUrls).getUrls(); } - private UrlSet buildUrlSet() throws IOException { + private UrlSet buildUrlSet(List<URL> resourceUrls) throws IOException { ClassLoaderInterface classLoaderInterface = getClassLoaderInterface(); - UrlSet urlSet = new UrlSet(classLoaderInterface, this.fileProtocols); + UrlSet urlSet = new UrlSet(resourceUrls); + urlSet.include(new UrlSet(classLoaderInterface, this.fileProtocols)); //excluding the urls found by the parent class loader is desired, but fails in JBoss (all urls are removed) if (excludeParentClassLoader) {