aspose file tools*
The moose likes JBoss/WildFly and the fly likes Configuration management of JBoss files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Configuration management of JBoss files" Watch "Configuration management of JBoss files" New topic
Author

Configuration management of JBoss files

Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2771
    
  10

I've worked on many web applications deployed to various app servers, and so far haven't really found an ideal way to push out changes to server configuration files that fall outside the ears, wars, jars or whatever, which we deploy through the normal build process. JBoss, in particular, has dozens of XML files distributed throughout server/default/conf and server/default/deploy that can be tweaked to enable features and improve performance. At the moment we just push these out to the other developers on an ad hoc, which, even though it's rarely necessary, is still a big PITA.

I'm interested how others are handling it. Do you put the entire server/default/deploy (less your deployed artifacts) and server/default/conf directories into source control, or just XML files, or just files that vary from the default distro?
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5776
    
    7

I store only the modified config files in source control. And my Ant build script deploys the config files along with the app.


JBoss In Action
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2771
    
  10

Good advice, and that's probably what we'll do. A few more questions though:

I often modify my jboss-log4j.xml locally to see some more or less logging in areas I'm interested in. It would be annoying if my local changes got wiped out every time I did a build. Do you just change that file in the project and then be careful not to check it in?

We have SSL enabled, and so need a keystore with a self-signed certificate. Do you put that in source code control? The domain name actually has to go into the cert. It can be localhost for all us developers, but on the shared server, it actually must contain the IP address. How have you solved that?

How about other files that may have a dev version and a production version?

Recently I disabled the JBoss root application by taking index.html away from the ROOT.war and replacing it with a 404.jsp. How do you distribute changes that require file deletions? Probably by updating your build's clean target, right?

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5776
    
    7

1) I would use Mercurial or Git and create the local repository in the conf directory.

2) I don't need ssl for what I have been doing. But I would store the cert in source control. In the cert I would place an expression such as ${domain.name} into the cert and then use a Ant (or Maven) build to replace that with the proper name.

3) Same as #2. Check out the ch00/src/main/db/jbia-ds.xml file that is part of the source code for JBoss in Action. I use this one file for all of the *-ds.xml files for the book - different datasource names and different database (mysql and posgresql). Both Ant and Maven are very good at this sort of thing. All deployment-specific information should be templated and applied via properties at build/deploy time.

4) I usually do that as part of my app server setup target. Look at how I set up the Ant script for the book. Essentially, you start with the JBoss AS zip file. The script extract the base files (everything except server/xxx) in one step, and then extracts 'default' (or 'all') as xxx, and then does some post processing to fix things up within server/xxx. That is the point at which I would replace the index.html with 404.jsp.
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2771
    
  10

Thanks Peter! That's very helpful, as your book has been. Our build uses Maven instead of Ant, which I don't understand as well, and so that's part of what I'm struggling with. One point I'm still confused on: the "cert" as I understand it is a binary file, so is it even possible to put a token like ${domain.name} in it? Also, to be useful, the cert has to be added into the trust store. I'll check into your Ant builds and see if I can figure out how you're handling that.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Configuration management of JBoss files
 
Similar Threads
Application properties
Can the properties file be maintained as part of the EAR or WAR, instead of in \conf (ie. seprately)
How to hot redeploy an app to JBoss?
another Eclipse & JBoss question
Need to disable access to my application using HTTP methods like PUT, DELETE at Jboss level