Praveen Gunda [
https://community.jboss.org/people/pgunda] created the discussion
"JBoss AS7: Reading Properties
ClassLoader.getSystemResource("PropertyFile") - Not working"
To view the discussion, visit:
https://community.jboss.org/message/799166#799166
--------------------------------------------------------------
I used the following article to configure loading properties from external folders.
https://community.jboss.org/docs/DOC-18247#/?page=2
https://community.jboss.org/wiki/HowToPutAnExternalFileInTheClasspath#/?p...
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
[
https://community.jboss.org/message/799166#799166]
Start a new discussion in JBoss Web Development at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]