0
votes

We have a JavaEE application running on a WebSphere application server (v7). We want to manage application configuration (key/value pairs) outside the EAR. We cannot use following options due to some valid non-technical reasons:

  1. External Database
  2. Shared File System
  3. Namespace Bindings in Websphere admin console
  4. Changes in WebSphere start-up script

Question: Are there any other ways of managing the configuraion in WebSphere console or outside the EAR?

Our current option is to package all configuration files inside EAR and repackage / redeploy the EAR in case of any changes.

I researched lot of articles and questions on this site. JavaEE solution configuration best practices address this issue from a best practices perspective. It still does not provide an option other than using a DB or namespace bindings.

2
Please clarify "outside the EAR"; do you mean you don't want to have to redeploy to update the this configuration? Please clarify "namespace bindings"; does that include application bindings? The standard EE solution would be to use an env-entry, and then specify values at deployment time.Brett Kail
Yes, I do not want to redeploy the EAR update the configuration. Namespace bindings are JNDI bindings (key /value pair) managed by the container via admin console. We cannot use env-entry as it would require redeployment after each change.Tushar
I think you either misunderstand how env-entry work, or you're not accurately describing your restrictions.Brett Kail

2 Answers

2
votes

The standard EE solution is to use env-entry. These can be configured during deployment, and they can be modified after deployment (Enterprise Applications > app > Environment entries) without requiring redeployment. They do not require server namespace bindings.

1
votes

Another option is to use "configured name bindings". You may find them in AdminConsole in:

Environment / Naming / Name space bindings

With "configured name bindings" you can bind a regular String to JNDI name. The nice thing about it is that changes are being immediately reflected in the JNDI. Values can be added/modified/removed via AdminConsole and wsadmin.

InfoCenter link: http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/topic/com.ibm.websphere.nd.doc/info/ae/ae/cnam_configured_bindings.html

Having a "configured name binding", you may lookup its value in JNDI using InitialContext. The preferred way is to configure name space binding in the application and resolve application binding to configured name binding. Then in your code you can lookup the name under java:comp.