JBoss Community

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

created by Praveen Gunda in JBoss Web Development - View the full discussion

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.

Reply to this message by going to Community

Start a new discussion in JBoss Web Development at Community