LoginSignup
4
5

More than 5 years have passed since last update.

tomcatに.warを再デプロイするとさっきまで動いていたWEBアプリが404しか返さなくなった

Posted at

概要

Tomcatのwebapps/に.warを置くと、しばらくしてフォルダに展開されWebアプリとして動くはずです。ところが、いつまでたっても404しか返さないという状況に陥ることがあります。

このとき、IDE(NetBeansで確認)からWebアプリをアンデプロイしようとしても、

FAIL - Unable to delete [***]. The continued presence of this file may cause problems.

というポップアップが出てアンデプロイに失敗してしまいました。

本記事はこの現象に対する解決策のメモです。

解決策

ポップアップのメッセージでググると解決策が説明されていました。
http://stackoverflow.com/questions/14873219/cannot-undeploy-a-web-app-completely-in-tomcat-7

[手順]

  1. tomcatを停止し、手動でWebアプリのフォルダを消去、またはIDE再起動後にIDEからアンデプロイを実行
  2. tomcatフォルダのconf/context.xmlを開き、ルート要素<Context>antiResourceLocking="true"という属性を追加(下記参照)
context.xml

<!-- Before -->
<Context>
  ...
</Context>

<!-- After -->
<Context antiResourceLocking="true">
  ...
</Context>

4
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5