# Connecting Elastic search with Spring Boot giving error while running

**URL:** <https://discuss.elastic.co/t/connecting-elastic-search-with-spring-boot-giving-error-while-running/135114>\
**Category:** Elasticsearch\
**Created:** [June 8, 2018, 8:47am UTC](https://discuss.elastic.co/t/connecting-elastic-search-with-spring-boot-giving-error-while-running/135114 "2018-06-08T08:47:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Archana\_Kumari](https://avatars.discourse-cdn.com/v4/letter/a/bc79bd/32.png) [@Archana\_Kumari](https://discuss.elastic.co/u/Archana_Kumari)\
**Post date:** [June 8, 2018, 8:47am UTC](https://discuss.elastic.co/t/connecting-elastic-search-with-spring-boot-giving-error-while-running/135114/1 "2018-06-08T08:47:33Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2018, 8:47am UTC](https://discuss.elastic.co/t/connecting-elastic-search-with-spring-boot-giving-error-while-running/135114/2 "2018-07-06T08:47:35Z")

</div>

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