3 Replies Latest reply on Mar 20, 2013 11:25 AM by Sven Plath

    JBoss 7 application loads resource from dependency, not from itself

    Sven Plath Newbie

      Hey,

       

      I have yet another thing I would like to share with you guys:

       

      Consider the following example:

      • deployment unit foo with resource.properties in the root of the jar.
      • deployment unit bar with resource.properties in the root of the jar.
      • foo depends on bar.

       

      Now, when trying to obtain the resource.properties using the following code:

       

      getClass().getResourceAsStream("/resource.properties");
      

       

      I always get the resource.properties of the dependency bar, not the resource.properties in the foo.jar.

       

      I also tried using getClass().getClassLoader() and all other available methods, behavior is the same all the time.

       

      Note that in JBoss 6, it is working as intended.

       

      Regards,

      Sven