zoukankan      html  css  js  c++  java
  • 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的时候,把要添加的文件   复制到    不压缩直接存储的文件  中   点击确定

  • 相关阅读:
    [已解决]import pymssql ImportError: libsybdb.so.5
    找出生成json中的error_code,并加以处理
    [转]正则匹配时对象必须为string or bytes-like object
    [转]python执行bash指令,如果指令返回错误,如何优雅的结束python程序
    group()与groups()的区别
    Unsupported major.minor version 51.0解决办法(转)
    谈谈互联网后端基础设施(转)
    java日志体系的思考(转)
    JAVA模块以及未来(转)
    使用Spring Loader或者Jrebel实现java 热部署
  • 原文地址:https://www.cnblogs.com/wpcnblog/p/15218951.html
Copyright © 2011-2022 走看看