0 Replies Latest reply on Jul 6, 2012 7:07 AM by Chaitanya Kulkarni

    ClassLoader.getResourceAsStream in Jboss 7 always returns null

    Chaitanya Kulkarni Newbie

      I have one my.sar file, structure defined is as follows

       

      my.sar

      |

      |

      |---------META-INF

      |         |

      |         |-----------------------jboss-deployment-structure.xml

      |         |-----------------------jboss-service.xml

       

      in jboss-deployment-structure.xml i have added multiple jar dependencies required by mbean classes defined under jboss-service.xml....

      Now my dependant class (referred by jar - <JBOSS-7-HOME/modules>) is referring to xml file by using below code,

       

       

      Thread thread = Thread.currentThread();

      ClassLoader contextClassLoader = thread.getContextClassLoader();

       

      InputStream in = contextClassLoader.getResourceAsStream(<xmlFileName>);

       

      but this above code is unable to find xml file... It always returns null.

       

      Could anybody help me to find out where to place required xml files so that class can find those xml files?

       

      Thanks.