Connecting Elastic search with Spring Boot giving error while running


(Archana Kumari) #1

I am trying to run the Spring boot application with command.

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

But i am getting the below exception:-

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)

Below is the POM:-


4.0.0
com.amadeus.topodb
peakviz
0.0.1-SNAPSHOT
jar

peakviz
http://maven.apache.org

org.springframework.boot spring-boot-starter-parent 1.5.9.RELEASE 1.8 org.springframework.boot spring-boot-starter org.springframework.boot spring-boot-starter-web org.springframework spring-jdbc org.springframework.boot spring-boot-starter-jdbc
<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 -->
org.springframework.boot spring-boot-maven-plugin

Can someone please help in resolving the issue.

Thank you in advance


(system) #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.