6 Replies Latest reply on Sep 27, 2012 5:08 AM by jaikiran pai

    Thread.currentThread().getContextClassLoader().getResource("") returns null

    pushpak1981 Novice

      We are having an ear application in which we are having our custom configuration files inside abc.ear/config/ folder. Our seam components use  Thread.currentThread().getContextClassLoader().getResource to read the configuration files from the config folder mentioned above. This code is working in Jboss 5.1 but when we migrated from JBoss5.1 to Jboss7.1b the  Thread.currentThread().getContextClassLoader().getResource returns null.


      We tried to display the current directory by  Thread.currentThread().getContextClassLoader().getResource("/") it is pointing to

      C:/jboss-as-7.1.0.Beta1b/modules/sun/jdk/main/service-loader-resources/. Our configuration files are not found at that location. Is this due to the Classloader changes in Jboss7.


      Is there any other way we can read the configuration files from our ear/config folder ?