gpt4 book ai didi

java - 无法打开嵌套条目“WEB-INF/lib/example.jar”

转载 作者:行者123 更新时间:2023-12-02 04:38:11 27 4
gpt4 key购买 nike

我有可执行的war文件要运行,我从WEB-INF/lib文件夹中删除了一个.jar文件。再次将相同的 jar 文件添加到相同的路径中,但无法运行 war 文件,出现以下错误

Exception in thread "main" java.lang.IllegalStateException: Failed to get nested archive for entry WEB-INF/lib/test-cts-chk-query-rest-app-1.0.5/com/testcorp/cts/chk/query/rest/app/ClearinghouseQueryRESTController.class at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:108) at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchives(JarFileArchive.java:86) at org.springframework.boot.loader.ExecutableArchiveLauncher.getClassPathArchives(ExecutableArchiveLauncher.java:70) at org.springframework.boot.loader.Launcher.launch(Launcher.java:49) at org.springframework.boot.loader.WarLauncher.main(WarLauncher.java:58) Caused by: java.io.IOException: Unable to open nested jar file 'WEB-INF/lib/test-cts-chk-query-rest-app-1.0.5/com/testcorp/cts/chk/query/rest/app/ClearinghouseQueryRESTController.class' at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:254) at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:239) at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:103) ... 4 more Caused by: java.lang.IllegalStateException: Unable to open nested entry 'WEB-INF/lib/test-cts-chk-query-rest-app-1.0.5/com/testcorp/cts/chk/query/rest/app/ClearinghouseQueryRESTController.class'. 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:282) at org.springframework.boot.loader.jar.JarFile.createJarFileFromEntry(JarFile.java:262) at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:250) ... 6 more

有没有办法在gradle项目上解决这个问题?

最佳答案

首先,如果您有一个 gradle 项目,那么您不需要添加外部 Jar,您可以编写一个 gradle 脚本来在程序中使用该 jar/class 文件。

第二件事,如果您刚刚在 Lib 目录中删除并添加了 jar,您需要清理并构建项目一次。

关于java - 无法打开嵌套条目“WEB-INF/lib/example.jar”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56538751/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com