This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes Web Application Design - Config files best locations - Dynamic/Static - JBoss AS 7 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Web Application Design - Config files best locations - Dynamic/Static - JBoss AS 7" Watch "Web Application Design - Config files best locations - Dynamic/Static - JBoss AS 7" New topic
Author

Web Application Design - Config files best locations - Dynamic/Static - JBoss AS 7

Santhosh Kalisamy
Ranch Hand

Joined: Apr 15, 2008
Posts: 56
Friends,

I am very much happy to share, we are upgrading our application to JBoss AS 7 + Java 7.

This is an excellent oppertunity to fix few design bugs...

Current Implementation is like this...




Now,
I have successfully moved the Output directories and all to a new location.

What is the best place to move Configuration files (from current bin)…?

1. JBOSS_HOME/conf
2. JBOSS_HOME/bin/conf
3. JBOSS_HOME/standalone/conf
4. JBOSS_HOME/standalone/deploy/deployments (already existing with JBoss)
5. JBOSS_HOME/standalone/deploy/configuration (already existing with JBoss)

If I place any of my configuration files to JBOSS_HOME/standalone/deploy/configuration [or] JBOSS_HOME/standalone/deploy/deployments, would it confuse JBoss AS server? Would it try to parse them or execute them?

Most of my config files are *.properties, *.xml, *.xsd (s)...

Please share your views...

And after all of this,

How to add a directory/location to the JBoss CLASSPATH?

Thanks in Millions...

Note:

I found 3 ways of reading config files...
Sharing this for someone's use...

1. CLASS PATH
Put it in the classpath, so that can load it by ClassLoader#getResourceAsStream() with a classpath-relative path:

2. CONTEXT PATH
Put it somewhere in web folder (the project's web content folder), so that you can load it by ServletContext#getResourceAsStream() with a webcontent-relative path:
This is out of option to me as I want the files Outside WAR/EAR.

3. STATIC
Put it somewhere in local disk file system so that you can load it the usual java.io way with an absolute local disk file system path:

Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9916
    
158

Typically you would just package those property files within the application packaging and use the #2 approach that you mention in your post. Is there a reason why you don't want that option?


[My Blog] [JavaRanch Journal]
Santhosh Kalisamy
Ranch Hand

Joined: Apr 15, 2008
Posts: 56
Thanks Jai.

Yes. Our BA team has the knowledge to edit the Properties files.

We do have few values to be configured.

Mostly, they update the properties file and restart the JBoss server without Developer's help.

If I build within Application packaging, I may need to rebuild the application.

One more thing, my client doesn't like rebuilding for LIVE environment. They want to use UAT Deployment files to deploy in Production. But, they are OK with us to change values on External properties files, which has few environment specific values/URLs.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Web Application Design - Config files best locations - Dynamic/Static - JBoss AS 7
 
Similar Threads
JBOSS 4.3.0 EAP Clustering with Apache HTTP Server 2.2.11
can't find css, images and js static files
How to set external config directory on classpath ?
JBoss-as-7.1.1 unable to start
Cannot conect to mySql DB after changing DB from HSQL to mySql in JBOSS 5