11 Replies Latest reply on Mar 7, 2013 5:23 AM by Amos Feng

    Thread.currentThread().getContextClassLoader().getResource() in .ear does not work when update to AS 8.0.0.Alpha1-SNAPSHOT

    Amos Feng Apprentice

      Hi all,

       

      we have an ear wiht the following struct:

      blacktie-admin-service-ear-5.0.0.M2.SNAPSHOT.ear

                   |--blacktie-admin-services-5.0.0.M2-SNAPSHOT.jar

                           |-- btconfig.xml

                   |--lib--|

                           |--others.jar

       

      and the application.xml

       

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE application PUBLIC
          "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
          "http://java.sun.com/dtd/application_1_3.dtd">
      <application>
        <display-name>blacktie-admin-services-ear</display-name>
        <description>BlackTie all files</description>
        <module>
          <java>blacktie-admin-services-5.0.0.M2-SNAPSHOT.jar</java>
        </module>
      </application>
      

       

      we use the following codes to get btconfig.xml by getResource() but now it does not work when update to AS 8.0.0.Alpha1

       

              URL resource = Thread.currentThread().getContextClassLoader().getResource(env);
              if (resource == null) {
                  throw new ConfigurationException("Could not find the file: " + env);
              }
      

       

      more details should be found on https://issues.jboss.org/browse/BLACKTIE-433. so I just want to know how to load the btconfig.xml in the .jar ?

       

      Thanks,

      Amos