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

后端 未结 15 2552
眼角桃花
眼角桃花 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 03:49

    I faced this issue, I didn't add anything or modify anything to my build. But I guess my issue raised because I was directly uploading my war file to remote tomcat7/webapps/ directory.

    Solution your war file to intermediate directory like /home/yourusername or something then move to your webapps directory. Probably for me this issue raised because file was not fully uploaded yet and tomcat was trying to extract/deploy it.

    Hope this will help someone.

    0 讨论(0)
  • 2020-12-14 03:50

    In my case I was using WinSCP to transfer the file. I tried many times with all the suggestions described here. All I did to make it work was restarting the WinSCP and the tomcat could read the file.

    0 讨论(0)
  • 2020-12-14 03:51

    I had the same problem (java.lang.IllegalArgumentException: Invalid or unreadable WAR file). For me, the cause was that I had catalina-6.0.43.jar included in my WAR file. To get rid of the error, I created a new WAR file that didn't include this jar, then Tomcat 7 was able to successfully start the application. Unfortunately, this solution only worked for Tomcat 7. I'm still getting the same error when I try to deploy the exact same WAR on Tomcat 8.

    0 讨论(0)
  • 2020-12-14 03:53

    i face same issue many times and finally i found the solution .. exact solution anyway i was using Tomcat 8.0.9 locally for testing and when upload the war file to server i got the error message with unzipping the war .. so i checked the server Tomcat and it was 6 so i installed that version and checked the version of Java on the server and found it 5 so i also make sure that i use version 5 on my local machine. the issue happen with how the war file packing so if you use same version and tomcat it will packed in correct way that server can understand ... another solution .. update the server version to match the one you use locally. they should be the same. hope this will solve your issue.

    0 讨论(0)
  • 2020-12-14 03:54

    In my case it was file corruption during file transfer caused this issue. Hence it's always a best practice to validate the checksum of the file whenever we transfer it to a remote server.

    0 讨论(0)
  • 2020-12-14 03:56

    If you are deploying on Linux then make sure it is readable by the user that the tomcat process is running as. Run "chmod +r" to the war file to add read rights to everyone.

    0 讨论(0)
提交回复
热议问题