JBoss Community

Re: reading application startup files in JBoss 4 vs 5

created by jaikiran pai in Beginner's Corner - View the full discussion

Please post the entire exception stacktrace? And how exactly are you reading that file? Using java.io.File? Instead for JavaEE applications, it's better to use the following code:

 

String startupFileName=...// get the file name from ENC
InputStream is = this.getClass().getClassLoader().getResourceAsStream(startupFileName);

 

 

The resource will then be looked within the classpath of the application. So you can either package that myserver.properties within your app or place it in JBOSS_HOME/server/servername/conf folder (which by default is available in classpath).

Reply to this message by going to Community

Start a new discussion in Beginner's Corner at Community