In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
The method used by the jar packaging command, for this problem, this article introduces the corresponding analysis and answer in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.
Today, the old version of the project produced a bug, but there was no branch on the svn at that time, so I decompiled it, found several files to be modified, replaced them, and found a prompt for startup failure (Spring boot project).
Exception in thread "main" java.lang.IllegalStateException: Unable to open nested entry 'BOOT-INF/lib/antlr-2.7.7.jar'.It has been compressed and nested jar files must be stored without compression. Please check the mechanism used to create your executable jar filePS E:\ pwd0508\ b2b-erp > java-jar.\ b2b-erp.jarException in thread "main" java.lang.IllegalStateException: Unable to open nested entry 'BOOT-INF/lib/antlr-2.7.7.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) at org.springframework.boot.loader.jar.JarFile.getNestedJarFile (JarFile.java:237) at org.springframework.boot .loader.archive.JarFileArchive.getNestedArchive (JarFileArchive.java:103) 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) Archive (JarLauncher.java:58)
Tip: the third-party package that jar relies on has been compressed. The hint is thrown by spring's Launcher. It should be a large package of its own, so you can't just take a look at the jar command:
PS E:\ pwd0508\ b2b-erp > jar usage: jar {ctxui} [vfmn0PMe] [jar-file] [manifest-file] [entry-point] [- C dir] files. Option:-c create new file-t list file directory-x extract specified (or all) files from file-u update existing file-v generate detailed output in standard output-f specify file name-m include manifest information in specified manifest file-n execute Pack200 after creating new file Canonical-e specifies the application entry point for standalone applications bundled to an executable jar file-0 stores only Do not use any ZIP compression-P preserves the leading'/'(absolute path) and ".." in the filename (parent directory) component-M does not create the manifest file for the item-I generates index information for the specified jar file-C changes to the specified directory and contains the following files if any file is a directory, it is recursively processed. The manifest file name, archive file name, and entry point name are specified in the same order as the 'masks,' f', and'e' tags. Example 1: archive two class files into a file called classes.jar: jar cvf classes.jar Foo.class Bar.class example 2: use the existing manifest file 'mymanifest' and archive all files in the foo/ directory into' classes.jar': jar cvfm classes.jar mymanifest-C foo/.
There is an option of-0, try [highlight]
Jar-cvf0m b2b-erp.jar.\ META-INF\ MANIFEST.MF.
Package successfully, execute the following, the spring boot icon came out successfully!
PS E:\ pwd0508\ b2b-erp > java-jar.\ b2b-erp.jar. _ _ / / _ _ _ (() _ _ _ |'_ _ _ | |\ / _ _ _ | | | (_ _ | |) )'| _ |. _ _ | _ | | _ | _ | | _\ _ _ | | / = | _ | = | _ _ / = /: Spring Boot:: (v1.4.1.RELEASE) 2017-05-09 10:09:02 INFO [main] com.qiaomai.erp.Application.logStarting:48-Starting Application v1.2.0 on PC201608251with PID 13664 (E:\ pwd0508\ b2b-erp\ b2b-erp.jar started by Administrator in E:\ pwd0508\ b2b-erp) 2017-05-09 10:09:02 INFO | [main] com.qiaomai.erp.Application.logStartupProfileInfo:665-The following profiles are active: dev2017-05-09 10:09:02 INFO [main] org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext.prepareRefresh:581-Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@5eb5c224: startup date [Tue May 09 10:09:02 CST 2017] Root of context hierarchy2017-05-09 10:09:03 INFO [background-preinit] org.hibernate.validator.internal.util.Version.:30-HV000001: this is the answer to Hibernate Validator 5.2.4.Final 's question about the method used by the jar packaging command. I hope the above content can be of some help to everyone. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.