0 Replies Latest reply on Feb 22, 2013 4:35 PM by Praveen Gunda

    JBoss AS7: Reading Properties ClassLoader.getSystemResource("PropertyFile") - Not working

    Praveen Gunda Newbie

      I used the following article to configure loading properties from external folders.

      https://community.jboss.org/wiki/HowToPutAnExternalFileInTheClasspath#/?page=2

       

      Everything seems to work as in the article. How ever, I am porting an WAR from websphere to JBoss AS7 and have slight problem with this.

       

      My application uses ClassLoader.getSystemResource("PropertyFile") to get the URL for the property file from Classpath. When I try this, I get a Null Pointer Exception

      I can successfully load using  this.getClass().getClassLoader().getResource("PropertyFile")

       

      I can not change it as this is being used all over the application.

      Why doesn't ClassLoader.getSystemResource("PropertyFile") not work ?

      Is there some configuration setting that can make it work? I am willing to move the properties files to a different location or may be include in the WAR if needed.

       

      Any Help is greatly appreciated.