Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Santhosh Kalisamy
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

 
Santhosh Kalisamy
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic