简体   繁体   中英

JavaEE Application Configuration Management in WebSphere (with restrictions)

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.

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM