I have a JBoss application which is deployed in its own directory, for example 
JBOSS_HOME/server/myapp/deploy/myapp.sar.  In this directory is a 
myapp.properties file.  I have been unsuccessful at loading the Properties 
contained in this file, and I can't figure out why.  First I tried a simple 
load using a FileInputStream, for example:


  | String propertiesFileName = "myapp.properties";
  | Properties myProperties;
  | myProperties.load(new FileInputStream(propertiesFileName));
  | 

I have also tried the following:


  | String propertiesFileName = "myapp.properties";
  | Properties myProperties;
  | InputStream inputStream = 
ClassLoader.getSystemClassLoader().getResourceAsStream(propertiesFileName);
  | myProperties.load(inputStream );
  | 


The first example resulted in a FileNotFoundException, and the second results 
in a NullPointerException.  

In the run.sh I use to start JBoss I have made sure that the application's 
directory is in the $JBOSS_CLASSPATH, in order to make the myapp.properties 
file easy to locate.

I am using JBoss 4.0.1.

Thanks in advance for any suggestions as to how I might make this work.


--James

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3865709#3865709

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3865709


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to