Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

External Web Application configuration options?

 
Chris Nappin
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the best way to have application configuration external to my ear file?

We don't want our customers (who are non-technical) to have to unpack our ear file, then war file, edit web.xml settings or nested properties files, then have to pack everything back up again.

We also need a solution that will work on any application server, e.g. ones that don't unpack the ear and war files as well as those that do, clustered and unclustered, any O/S etc.

My first thought is to use an external property file but this has a few problems:
- difficult to use a consistent file location (perhaps relative to the app server's "current directory" might be best?)
- it would limit our application to only having one instance per server instance

JNDI is pretty complex for a non-technical person to configure, especially in App servers that don't have a web-based configuration front end.

And the database is out because the configuration includes what database to connect to!

Anyone have any further ideas?

Thanks,

Chris.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chris,
Welcome to JavaRanch!

An external property file is the way to go.

difficult to use a consistent file location (perhaps relative to the app server's "current directory" might be best?)

You can have a property on the server that points to the file. Then just tell the customer where it is. This works if you know the directory exists. If not, you have to tell the customer where to set the path of the property file. Presumably the person deploying the app will be able to set it. Relative paths are another option, although they tend to be muckier. Non-technical people don't like being in the directories anywhere near the EAR.


it would limit our application to only having one instance per server instance

Why?
 
Chris Nappin
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply.

My comment about being limited to one app per server instance is that if we use a solution like a JVM system property or a global JNDI entry for the property file location, then obviously two instances on the same server would end up pointing at the same file.

We're thinking of going with an external property file, whose location and filename is set as a servlet context init parameter. This filename setting is then per-application, but the downside is that editing this setting requires unpacking and re-packaging the ear and war files.

But then I suppose if a customer wanted to set up several instances of our application on the same server then they'd have to edit the context path in the application.xml anyway.

Unless anyone knows of a tool a non-techie could use to alter the context path in an ear file?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic