[jboss-user] [Installation, Configuration & DEPLOYMENT] - Re: Adding configuration files to SAR deployment

PeterJ do-not-reply at jboss.com
Fri Jul 20 12:33:01 EDT 2007


If you want to place the cfg file outside your SAR, you could use one of the jboss system properties. (http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossProperties).  For example. place the cgf in server/xxx/data and locate it using the jboss.server.data.dir property.

If you want to place the cfgfile inside your SAR, place it in a JAR (could be exploded) and access it using Class.getResource() or Class.getResourceAsStream().  For example, assume the following SAR layout:

some.sar
  | + config.jar
  |   + some
  |     + config
  |       + myconfig.cfg

You can access the cfg file as follows:

InputStream is = this.getClass().getResourceAsStream("/some/config/myconfig.cfg")


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

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



More information about the jboss-user mailing list