diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java b/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java index 2c24dd3ba..4aa86a840 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java @@ -401,18 +401,19 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder { } private List readUrls() throws IOException { - List list = buildUrlSet().getUrls(); + List resourceUrls = new ArrayList(); // Usually the "classes" dir. ArrayList 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 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) {