1 Reply Latest reply on Dec 23, 2014 9:02 AM by franzm

    Wildfly 8.1 and Spring getResources does not work

    franzm

      Hi,

       

      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?

       

      Thanks

        • 1. Re: Wildfly 8.1 and Spring getResources does not work
          franzm

          We have upgraded Spring from 2.5.6 (very old version) to 3.1.2.RELEASE and to Wildfly 8.2.FINAL and the problem is gone. Seams to be that Spring has fixed this issue quite some time ago.

          Sometimes old software on a brand new app server makes some strange problems....