2 Replies Latest reply on Apr 7, 2004 8:49 AM by John Deviney

    Problem accessing bundled text file

    John Deviney Newbie

      I'm working on a Weblogic => Jboss conversion.

      Deployment scenario:

      abc.ear
      * abc-ejb.jar
      * abc.war
      * abc.wsr
      * abc-resource.jar (no classes)

      In abc-ejb.jar I have a non-EJB class attempting to load a text file from abc-resource.jar using the following syntax:

      InputStream fileResource = this.getClass().getClassLoader().getResourceAsStream(TEMPLATE_LOCATION + "/" + templateName);

      Result is always null. The resource path appears valid as: /abc/email templates/passwordChange.txt

      That is how the file is bundled in abc-resource.jar.

      This worked fine under Weblogic 6.1.

      After reading through posts on similar problems I have tried the following without success:

      1) specified abc-resource.jar as a java module inside of my application.xml for abc.ear
      2) bundled abc-resource.jar inside of abc-ejb.jar
      3) placed abc-resource.jar in each of the lib directories under jboss root.
      4) verified that abc-resource.jar is listed in the manifest classpath for abc-ejb.jar
      5) I also verified that a test class placed in abc-resource.jar can be loaded from a class in abc-ejb.jar in each of the cases above. Class loading in and of itself does not appear to be the problem.

      Any help is appreciated.

      jhd