gpt4 book ai didi

spring - Sprint 引导错误无法获取条目 BOOT-INF/lib/lucene-analyzers-common-7.1.0.jar 的嵌套存档

转载 作者:行者123 更新时间:2023-12-02 22:36:28 46 4
gpt4 key购买 nike

我正在尝试使用命令运行 Spring boot 应用程序

java -jar /home/atrium/ElasticSearch/peakviz-0.0.1-SNAPSHOT.jar

但我收到以下异常:-

Exception in thread "main" java.lang.IllegalStateException: Failed to get nested archive for entry BOOT-INF/lib/lucene-analyzers-common-7.1.0.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/lucene-analyzers-common-7.1.0.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.IndexOutOfBoundsException at org.springframework.boot.loader.jar.AsciiBytes.(AsciiBytes.java:69) at org.springframework.boot.loader.jar.CentralDirectoryFileHeader.load(CentralDirectoryFileHeader.java:95) at org.springframework.boot.loader.jar.CentralDirectoryParser.parseEntries(CentralDirectoryParser.java:68) at org.springframework.boot.loader.jar.CentralDirectoryParser.parse(CentralDirectoryParser.java:57) at org.springframework.boot.loader.jar.JarFile.(JarFile.java:118) at org.springframework.boot.loader.jar.JarFile.(JarFile.java:106) at org.springframework.boot.loader.jar.JarFile.createJarFileFromFileEntry(JarFile.java:290) at org.springframework.boot.loader.jar.JarFile.createJarFileFromEntry(JarFile.java:260) at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:248)

下面是 POM:-

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<groupId>com.amadeus.topodb</groupId>
<artifactId>peakviz</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>peakviz</name>
<url>http://maven.apache.org</url>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
<!-- <version>1.2.5.RELEASE</version> -->
</parent>

<properties>
<java.version>1.8</java.version>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<!-- Elastic Start -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- Elastic End -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>

<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.30</version>
</dependency>


<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>

<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20140107</version>
</dependency>

<!-- <dependency> <groupId>org.elasticsearch</groupId> <artifactId>elasticsearch</artifactId>
<version>1.4.3</version> </dependency> <dependency> <groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId> <version>1.1.2.RELEASE</version>
</dependency> -->

<!-- Elasticsearch Dependencies Start -->
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>6.1.2</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
<version>6.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-client</artifactId>
<version>6.1.2</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-client-sniffer</artifactId>
<version>6.1.2</version>
</dependency>
<!-- Elasticsearch Dependencies end -->
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

有人可以帮助解决这个问题吗。

提前致谢

最佳答案

首先您需要检查哪个 jar 导入了 lucene-analyzers-common。那么建议您移除mvn-shade-plugin来解决这个问题。

关于spring - Sprint 引导错误无法获取条目 BOOT-INF/lib/lucene-analyzers-common-7.1.0.jar 的嵌套存档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50737501/

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