Hi Peter,
Thanks for the reply. I've tried two different methods to access the config file: 1)
using the FileUtils and 2) getClass().getClassLoader().getResourceAsStream()
Here is the relevant code from each:
1)
public String getFileContents(String fileName) {
| StringBuffer contents = new StringBuffer();
|
| try {
| BufferedReader br = new BufferedReader(new
| InputStreamReader(new FileInputStream(fileName)));
| String input = br.readLine();
| while (input != null) {
| contents.append(input);
| input = br.readLine();
| }
| br.close();
| } catch (Exception e) {
| log.error(e);
| }
|
| return contents.toString();
| }
And then method 2:
InputStream is =
getClass().getClassLoader().getResourceAsStream("/config.xml");
The InputStream is null. Also, I am using JBoss AS 4.2.3.
Thanks,
John
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4180046#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...