- 生产服务环境:几年前的老项目,中间件用的WAS8.5,操作系统是windows
- 事件简述:昨天更新生产环境,代码中包含web.xml,跟往常一样,我们通过WAS控制台多文件增量更新,以往通过WAS控制台更新都没出现过web.xml文件不生效的问题,本次不知怎么回事web.xml文件中新增的内容始终不生效。
- 解决问题尝试一:手动修改以下四个文件将本次新增内容手动加进去,然后重启server。
-
C:\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-TO23CAI343C3Node01Cell\应用名称_war.ear\应用名称.war\WEB-INF\web_merged.xml
C:\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-TO23CAI343C3Node01Cell\应用名称_war.ear\应用名称.war\WEB-INF\web.xml
C:\IBM\WebSphere\AppServer\profiles\AppSrv01\config\cells\WIN-TO23CAI343C3Node01Cell\applications\应用名称_war.ear\deployments\应用名称_war\应用名称.war\WEB-INF\web_merged.xml
C:\IBM\WebSphere\AppServer\profiles\AppSrv01\config\cells\WIN-TO23CAI343C3Node01Cell\applications\应用名称_war.ear\deployments\应用名称_war\应用名称.war\WEB-INF\web.xml
结果server无法启动,无奈只有将文件还原回去。
- 解决问题尝试一:通过was控制台更新单个web.xml,结果还是不生效
- 最终解决办法:经过反复验证最终确定真正起作用的是
C:\IBM\WebSphere\AppServer\profiles\AppSrv01\config\cells\WIN-TO23CAI343C3Node01Cell\applications\应用名称_war.ear\deployments\应用名称_war\应用名称.war\WEB-INF\web_merged.xml
为保险起见最终我将本次新增的代码分别添加到
C:\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-TO23CAI343C3Node01Cell\应用名称_war.ear\应用名称.war\WEB-INF\web_merged.xml
C:\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-TO23CAI343C3Node01Cell\应用名称_war.ear\应用名称.war\WEB-INF\web.xml
C:\IBM\WebSphere\AppServer\profiles\AppSrv01\config\cells\WIN-TO23CAI343C3Node01Cell\applications\应用名称_war.ear\deployments\应用名称_war\应用名称.war\WEB-INF\web_merged.xml
C:\IBM\WebSphere\AppServer\profiles\AppSrv01\config\cells\WIN-TO23CAI343C3Node01Cell\applications\应用名称_war.ear\deployments\应用名称_war\应用名称.war\WEB-INF\web.xml
这四个文件中,最后重启WAS(重启应用和server都无效),问题得以解决。