1 Reply Latest reply on Dec 23, 2014 9:02 AM by Franz Müller

    Wildfly 8.1 and Spring getResources does not work

    Franz Müller Newbie



      I am migrating an old app to Wildfly 8.1.Final and struggling with Springs Resource loading. Spring provides a method to load resources from the classpath using an ant-style path: "classpath*:template/*.xml" (class: PathMatchingResourcePatternResolver). So I am looking for all files in the classpath ending with .xml and being in the directory template. Everything works fine with JBoss 4.2.2 and in a console Java app. I am using Java 7 and all classes and XML files are in JAR files deployed as a WAR file. The JAR files are located in the WAR file in WEB-INF/lib.

      If I understand Wildfly correctly then this should be no classloader problem as Spring and my own JARs are all located in the WAR file. I debugged a bit and I think the problem is that Wildflys ModuleClassloader returns URLs starting with a protocol called "vfs:". Spring doesn't understand this and fails to scan the classpath.


      Anybody struggelled with this problem too and has an idea how to solve or work around it?