Executable jar file not working for ElasticSearch


(Ayush Rastogi) #1

ElasticSearch - 5.3.0
Ubuntu- 14.04
Hello,
I created the maven project for insert the data in ElasticSearch.It's working fine when I executed the code in eclipse.then I create the jar file with dependencies for this project.but when I executed the jar file I am getting the following errors -

Exception in thread "main" java.lang.ExceptionInInitializerError
at org.elasticsearch.common.logging.DeprecationLogger.(DeprecationLogger.java:138)
at org.elasticsearch.common.xcontent.support.AbstractXContentParser.(AbstractXContentParser.java:57)
at org.elasticsearch.common.xcontent.json.JsonXContentParser.(JsonXContentParser.java:44)
at org.elasticsearch.common.xcontent.json.JsonXContent.createParser(JsonXContent.java:103)
at org.elasticsearch.common.settings.Setting.parseableStringToList(Setting.java:832)
at org.elasticsearch.common.settings.Setting.lambda$listSetting$27(Setting.java:786)
at org.elasticsearch.common.settings.Setting.listSetting(Setting.java:791)
at org.elasticsearch.common.settings.Setting.listSetting(Setting.java:786)
at org.elasticsearch.common.network.NetworkService.(NetworkService.java:50)
at org.elasticsearch.client.transport.TransportClient.newPluginService(TransportClient.java:98)
at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.java:126)
at org.elasticsearch.client.transport.TransportClient.(TransportClient.java:268)
at org.elasticsearch.transport.client.PreBuiltTransportClient.(PreBuiltTransportClient.java:125)
at org.elasticsearch.transport.client.PreBuiltTransportClient.(PreBuiltTransportClient.java:111)
at org.elasticsearch.transport.client.PreBuiltTransportClient.(PreBuiltTransportClient.java:101)
at org.formcept.Es.Test.main(Test.java:79)
Caused by: java.lang.IllegalStateException: Error finding the build shortHash. Stopping Elasticsearch now so it doesn't run in subtly broken ways. This is likely a build bug.
at org.elasticsearch.Build.(Build.java:62)
... 16 more

and my pom.xml file look like this -

4.0.0 org.formcept ES_New 0.0.1-SNAPSHOT ES New New project in ElasticSearch 1.8 2.5 4.11 ES-snapshots https://oss.sonatype.org/content/groups/staging central http://repo1.maven.org/maven2/ elasticsearch-releases https://artifacts.elastic.co/maven true false org.apache.lucene lucene-grouping 6.5.0
	<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.0</version>
	<dependency>
		<groupId>org.elasticsearch</groupId>
		<artifactId>elasticsearch</artifactId>
		<version>5.3.0</version>
	</dependency>
	<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
<version>5.3.0</version>
org.apache.logging.log4j log4j-api 2.7 org.apache.logging.log4j log4j-core 2.7 junit junit ${junit.version} test joda-time joda-time ${jodatime.version} path
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-eclipse-plugin</artifactId>
			<version>2.10</version>
			<configuration>
				<downloadSources>true</downloadSources>
				<downloadJavadocs>false</downloadJavadocs>
			</configuration>
		</plugin>

	
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-compiler-plugin</artifactId>
			<version>3.6.1</version>
			<configuration>
				<source>${jdk.version}</source>
				<target>${jdk.version}</target>
			</configuration>
		</plugin>

		
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-assembly-plugin</artifactId>
			<version>3.0.0</version>
			<configuration>
				
				<descriptorRefs>
					<descriptorRef>jar-with-dependencies</descriptorRef>
				</descriptorRefs>
				
				<archive>
				  <manifest>
					<mainClass>org.formcept.Es.test</mainClass>
				  </manifest>
				</archive>

			</configuration>
			<executions>
			  <execution>
				<id>make-assembly</id>
                                   
				<phase>package</phase>
				<goals>
					<goal>single</goal>
				</goals>
			  </execution>
			</executions>
		</plugin>

	</plugins>
</build>

(Simon Willnauer) #2

if you repackage our jar you have to include all meta descriptors too otherwise we might miss resources like in your case.


(system) #3

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