java.lang.IllegalArgumentException: Invalid or unreadable WAR file : error in opening zip file

后端 未结 15 2575
眼角桃花
眼角桃花 2020-12-14 03:19


I got this error in Catalina.2011-03-30.log when my display.war file executed on Tomcat. The error is shown below:

Mar 30, 2011 8:01:31 PM org.apac         


        
15条回答
  •  爱一瞬间的悲伤
    2020-12-14 04:14

    I've encountered the error randomly. I think the cause is quite simple.

    It can happen when you create the WAR file and transfer it into the tomcat directory by a "slow" process. In my case it is a tranfer from a remote machine by scp. The tomcat can notice that the file has changed (modification date, etc.) before the transfer is over. It may then try to deploy the incomplete file. It will encounter a zip error.

    The same can in theory happen if you copy the file from another directory; though the chances are smaller, since the copy is faster.

    To avoid the error altogether, the file should be moved (not copied) from another location on the same disk. Such a move is (I think) atomic.

    While I am developing, having the error occur every once in a while is not a big problem, though; when I encounter it I just restart the transfer.

提交回复
热议问题