tomcat啟動報錯java.util.zip.ZipException:invalidCENheader(badsignature)
war包部署到tomcat裡,啟動時報錯:
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@7e21e65f]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:136)
at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:699)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
... 14 more
Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: invalid CEN header (bad signature)
at org.apache.catalina.webresources.JarResourceSet.initInternal(JarResourceSet.java:139)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
... 17 more
Caused by: java.util.zip.ZipException: invalid CEN header (bad signature)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:214)
at java.util.zip.ZipFile.<init>(ZipFile.java:144)
at java.util.jar.JarFile.<init>(JarFile.java:152)
at java.util.jar.JarFile.<init>(JarFile.java:89)
at org.apache.catalina.webresources.JarResourceSet.initInternal(JarResourceSet.java:136)
... 18 more
根據ZipException報錯,懷疑是jar包有損壞。
為了定位是哪個jar包,使用下面shell指令碼,用jar命令測試jar包:
cd WEB-INF/lib/
for j in *.jar; do echo $j; jar tvf $j > /dev/null ; echo $j done; done
正常的jar包只列印出jar的檔名,損壞的jar包會列印出錯誤資訊
aspectjweaver-1.6.9.jar
java.util.zip.ZipException: invalid CEN header (bad signature)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:225)
at java.util.zip.ZipFile.<init>(ZipFile.java:155)
at java.util.zip.ZipFile.<init>(ZipFile.java:126)
at sun.tools.jar.Main.list(Main.java:1115)
at sun.tools.jar.Main.run(Main.java:293)
at sun.tools.jar.Main.main(Main.java:1288)
從maven倉庫中刪除這個jar,重新maven打包。
另外,遇到 invalid LOC header (bad signature) 錯誤,
用jar tvf命令就檢查不出來了。可以使用unzip -t命令檢測。
for j in *.jar; do echo $j; unzip -t $j > /dev/null ; if [ $? -ne 0 ]; then echo $j error; fi; echo $j done; done
mysql-connector-java-5.1.27.jar
warning [mysql-connector-java-5.1.27.jar]: 317386 extra bytes at beginning or within zipfile
(attempting to process anyway)
file #1: bad zipfile offset (local header sig): 317386
(attempting to re-compensate)
mysql-connector-java-5.1.27.jar error
相關文章
- tomcat5啟動NotSerializableException報錯解決TomcatException
- Tomcat啟動報錯:Error starting static Resources解決方法TomcatError
- maven外掛 tomcat7啟動報錯,異常如下MavenTomcat
- mongodb 啟動報錯MongoDB
- php啟動報錯PHP
- tomcat啟動超時以及啟動之後開啟網頁報404錯誤的解決方法Tomcat網頁
- myeclipse啟動報錯Eclipse
- 本地nacos啟動報錯
- Tomcat啟動後頁面可以正常訪問 介面路徑報錯404Tomcat
- Tomcat啟動時Initializing Spring FrameworkServlet 'springmvc'卡住,並且不報錯TomcatFrameworkServletSpringMVC
- 報錯com.android.build.api.transform.TransformException: java.util.zip.ZipException:AndroidUIAPIORMExceptionJava
- Homestead 啟動 elasticsearch 報錯Elasticsearch
- apache啟動報錯:httpd: aprApachehttpd
- laravel sail 首次啟動報錯LaravelAI
- sqlplus 啟動報錯SQL
- 啟動ASM 例項報錯ASM
- tomcat-啟動報錯Multiple Contexts have a path of "/xxxx"TomcatContext
- tomcat 啟動應用報錯:java.sql.SQLException: Io 異常: Connection resetTomcatJavaSQLException
- tomcat釋出報錯Tomcat
- weblogic 部署應用的時候報錯 java.util.zip.ZipException: ErrorWebJavaExceptionError
- 關於Tomcat啟動報錯:Failed to initialize end point associated with ProtocolHandler ["http-apr-8080"]TomcatAIProtocolHTTP
- 關於mybatis tomcat 和jetty啟動報 {dataSource-1} inited 錯誤的記錄MyBatisTomcatJetty
- Mac 上啟動 appium 報錯MacAPP
- mongodb啟動報錯怎麼辦MongoDB
- Centos7啟動Nginx報錯。CentOSNginx
- Apache Hive啟動報NoClassDefFoundError錯誤ApacheHiveError
- 解決啟動Tomcat報錯:Failed to destroy end point associated with ProtocolHandler["ajp-nio-8009"]TomcatAIProtocol
- zabbix-server啟動報錯解決Server
- nginx 啟動報錯 unknown directive "server"NginxServer
- mysql安裝/啟動報錯彙總MySql
- springboot專案啟動報錯Spring Boot
- DBCA啟動報錯Java.Lang.NoclassdeffounderrorJavaError
- Tomcat啟動指令碼Tomcat指令碼
- tomcat 啟動失敗Tomcat
- tomcat 報錯 java.lang.OutOfMemoryErroTomcatJava
- Tomcat 7 啟動分析(一)啟動指令碼Tomcat指令碼
- ElasticSearch啟動報錯 ERROR: [4] bootstrap checks failedElasticsearchErrorbootAI
- Xcode啟動RN報錯"`fsevents` unavailable"XCodeAI