[jboss-dev-forums] [JBoss Web Development] - JBoss AS7: Reading Properties ClassLoader.getSystemResource("PropertyFile") - Not working

Praveen Gunda do-not-reply at jboss.com
Fri Feb 22 16:35:44 EST 2013


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#/?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
[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&containerType=14&container=2112]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20130222/7633cba4/attachment.html 


More information about the jboss-dev-forums mailing list