문제

I hava a web application (*.war) deployed to a WebSphere Application Server 7.0. In the deployment descriptor (web.xml) I have defined several ennvironment entries using the <env-entry>-Tag. I can configure these environment entries (change/set their values) using the administrative console. However, when I a update my web application to a new version (at first I check the box next to the entry for my application in the applications list, then I select "Update" from the offered actions) the values I had configured already get lost respectively overwritten with the values defined in the deployment descriptor.

Is this behaviour correct and in sync with the Java EE specification? If yes, is there a ways to prevent this? I've got about 10 environment entries which are different for each installation and it's painful to reconfigure them every time you update to a new version of the web application.

In Apache Tomcat 6.0 I am used to being able to overwrite the environment entries from the web.xml in the context.xml. This file does not get overwritten in case I re-deploy my application using a new version. Thus I don't have to reconfigure my application everytime I deploy a new version.

도움이 되었습니까?

해결책

The values defined in the web.xml file will always override the values you have modified with the admin console or by script. Solutions are :

  1. Remove the values from the web.xml file. The first time you deploy the application you need to set the values. But after that when updating the application, all the values will not be overridden.

  2. Leave the values in the web.xml and deploy by script (and not by the admin console). Here you can set the values when deploying the application with the -MapEnvEntryForWebMod option.

다른 팁

I remember seeing similar problems when deploying a WAR file directly. Instead you should build an EAR that contains the WAR and then deploy that EAR.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top