• Unable to open nested entry ********.jar 问题解决


    今天把现网版本的task的jar拖回来然后用7-zip打开拖了一个jar进去替换mysql-connector-java-5.1.47.jar  为  mysql-connector-java-5.1.27.jar

    启动微服务的时候就报错下面的

    Exception in thread "main" java.lang.IllegalStateException: Failed to get nested archive for entry BOOT-INF/lib/mysql-connector-java-5.1.27.jar
    at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:109)
    at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchives(JarFileArchive.java:87)
    at org.springframework.boot.loader.ExecutableArchiveLauncher.getClassPathArchives(ExecutableArchiveLauncher.java:72)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:49)
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
    Caused by: java.io.IOException: Unable to open nested jar file 'BOOT-INF/lib/mysql-connector-java-5.1.27.jar'
    at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:252)
    at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:237)
    at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:104)
    ... 4 more
    Caused by: java.lang.IllegalStateException: Unable to open nested entry 'BOOT-INF/lib/mysql-connector-java-5.1.27.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:285)
    at org.springframework.boot.loader.jar.JarFile.createJarFileFromEntry(JarFile.java:260)
    at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:248)
    ... 6 more

    后来发现问题原因是用7-zip拖进去的jar又被压缩了一次

    网上查发现用winrar的  不压缩直接存储的文件   功能可以拖进去而不压缩mysql-connector-java-5.1.27.jar

    然后重启task微服务就可以了

    注意在把jar拖进去task微服务jar的时候,把要添加的文件   复制到    不压缩直接存储的文件  中   点击确定

  • 相关阅读:
    Axis2创建WebService服务端接口+SoupUI以及Client端demo测试调用
    python 网络爬虫 scapy 下载 论坛帖子链接和标题
    scrapy抓中文,保存csv文件乱码解决方法
    python 3 map函数用法
    HTML基础信息笔记
    css提取数据2个常用方法
    Python3 scrapy 新手命令
    Python3.0 urllib request自己第一成功做出爬虫
    python geopandas读取保存文件中文属性乱码
    arcmap中dissolve时ERROR000210
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13317272.html
Copyright © 2020-2023  润新知