栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

SpringBoot jar包部署 Exception in thread “main“ java.lang.IllegalStateException

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

SpringBoot jar包部署 Exception in thread “main“ java.lang.IllegalStateException

Exception in thread "main" java.lang.IllegalStateException: Failed to get nested archive for entry BOOT-INF/lib/fastjson-1.2.83.jar
        at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:113)
        at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchives(JarFileArchive.java:87)
        at org.springframework.boot.loader.ExecutableArchiveLauncher.getClassPathArchives(ExecutableArchiveLauncher.java:69)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)
Caused by: java.io.IOException: Unable to open nested jar file 'BOOT-INF/lib/fastjson-1.2.83.jar'
        at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:261)
        at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:247)
        at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:109)
        ... 4 more
Caused by: java.lang.IllegalStateException: Unable to open nested entry 'BOOT-INF/lib/fastjson-1.2.83.jar'. It has been compressed and nested jar files must be stored without compression
. Please check the mechanism used to create your executable jar file
        at org.springframework.boot.loader.jar.JarFile.createJarFileFromFileEntry(JarFile.java:287)
        at org.springframework.boot.loader.jar.JarFile.createJarFileFromEntry(JarFile.java:269)
        at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:258)
        ... 6 more

最近修复fastjson漏洞,出完方案后,现场同事替换jar包中对应lib包下的fastjson低版本包,通过java -jar启动项目报错。

解决方法如下:

1)解压jar包:

       jar -xvf testDemo-0.0.1-SNAPSHOT.jar

2)替换文件

3)压缩jar包:

       jar -cfM0 testDemo-0.0.1-SNAPSHOT.jar ./

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/970165.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号