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

时间:2018-06-07 09:17:38

标签: spring spring-boot elasticsearch

我正在尝试使用命令

运行Spring启动应用程序
java -jar /home/atrium/ElasticSearch/peakviz-0.0.1-SNAPSHOT.jar

但我得到以下例外: -

  

线程中的异常" main" java.lang.IllegalStateException:失败   获取嵌套存档以进行输入   BOOT-INF / lib目录/ Lucene的-分析仪,共7.1.0.jar           在org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:109)           在org.springframework.boot.loader.archive.JarFileArchive.getNestedArchives(JarFileArchive.java:87)           在org.springframework.boot.loader.ExecutableArchiveLauncher.getClassPathArchives(ExecutableArchiveLauncher.java:72)           在org.springframework.boot.loader.Launcher.launch(Launcher.java:49)           在org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)   引起:java.io.IOException:无法打开嵌套的jar文件   ' BOOT-INF / LIB / lucene的-分析器-共7.1.0.jar'           在org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:252)           在org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:237)           在org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:104)           ... 4更多引起:java.lang.IndexOutOfBoundsException           在org.springframework.boot.loader.jar.AsciiBytes。(AsciiBytes.java:69)           在org.springframework.boot.loader.jar.CentralDirectoryFileHeader.load(CentralDirectoryFileHeader.java:95)           在org.springframework.boot.loader.jar.CentralDirectoryParser.parseEntries(CentralDirectoryParser.java:68)           在org.springframework.boot.loader.jar.CentralDirectoryParser.parse(CentralDirectoryParser.java:57)           在org.springframework.boot.loader.jar.JarFile。(JarFile.java:118)           在org.springframework.boot.loader.jar.JarFile。(JarFile.java:106)           在org.springframework.boot.loader.jar.JarFile.createJarFileFromFileEntry(JarFile.java:290)           在org.springframework.boot.loader.jar.JarFile.createJarFileFromEntry(JarFile.java:260)           在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>

有人可以帮助解决问题。

提前谢谢

1 个答案:

答案 0 :(得分:0)

首先,您需要检查哪个瓶子进口lucene-analyzers-common。 然后建议您删除mvn-shade-plugin以解决此问题。