Elastic search error

I intend to fix bugs in the open source Elastic Search project. I forked it and cloned the forked copy. Then I imported it as a Maven project on Eclipse and then created Maven. So far, so good. I opened the ElasticSearchF.java file and tried to run it as a Java application (this is as stated at http://www.lindstromhenrik.com/debugging-elasticsearch-in-eclipse/ ).

But I get the error: path.home is not set for ElasticSearch and throws IllegalStateException.

My question

  • Why this error occurs in the first place.
  • As I said, I want to fix bugs in the ElasticSearch project. Is this the correct way to set up the environment for my purpose? Or I need the client to send requests to the ElasticSearch server and then set debug points in the Elastic Search source code. How do you achieve this?

Thank you for your patience.

Update: I added a VM argument as one of the responders mentioned.

Then it throws different errors and it doesn't matter why it throws it.

java.io.IOException: Resource not found: "org/joda/time/tz/data/ZoneInfoMap" ClassLoader: sun.misc.Launcher$AppClassLoader@29578426
    at org.joda.time.tz.ZoneInfoProvider.openResource(ZoneInfoProvider.java:210)
    at org.joda.time.tz.ZoneInfoProvider.<init>(ZoneInfoProvider.java:127)
    at org.joda.time.tz.ZoneInfoProvider.<init>(ZoneInfoProvider.java:86)
    at org.joda.time.DateTimeZone.getDefaultProvider(DateTimeZone.java:514)
    at org.joda.time.DateTimeZone.getProvider(DateTimeZone.java:413)
    at org.joda.time.DateTimeZone.forID(DateTimeZone.java:216)
    at org.joda.time.DateTimeZone.getDefault(DateTimeZone.java:151)
    at org.joda.time.chrono.ISOChronology.getInstance(ISOChronology.java:79)
    at org.joda.time.DateTimeUtils.getChronology(DateTimeUtils.java:266)
    at org.joda.time.format.DateTimeFormatter.selectChronology(DateTimeFormatter.java:968)
    at org.joda.time.format.DateTimeFormatter.printTo(DateTimeFormatter.java:672)
    at org.joda.time.format.DateTimeFormatter.printTo(DateTimeFormatter.java:560)
    at org.joda.time.format.DateTimeFormatter.print(DateTimeFormatter.java:644)
    at org.elasticsearch.Build.<clinit>(Build.java:53)
    at org.elasticsearch.node.Node.<init>(Node.java:138)
    at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:157)
    at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:177)
    at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:278)
    at org.elasticsearch.bootstrap.ElasticsearchF.main(ElasticsearchF.java:30)
[2015-06-16 18:51:36,892][INFO ][node                     ] [Kismet Deadly] version[2.0.0-SNAPSHOT], pid[2516], build[9b833fd/2015-06-15T03:38:40Z]
[2015-06-16 18:51:36,892][INFO ][node                     ] [Kismet Deadly] initializing ...
[2015-06-16 18:51:36,899][INFO ][plugins                  ] [Kismet Deadly] loaded [], sites []
{2.0.0-SNAPSHOT}: Initialization Failed ...
- ExceptionInInitializerError
    IllegalArgumentException[An SPI class of type org.apache.lucene.codecs.PostingsFormat with name 'Lucene50' does not exist.  You need to add the corresponding JAR file supporting this SPI to your classpath.  The current classpath supports the following names: [es090, completion090, XBloomFilter]]

      

+3


source to share


2 answers


I got help from the developer community at https://github.com/elastic/elasticsearch/issues/12737 and was able to debug it.

In short, the procedure

:

1) Find the Elasticsearch.java/ElasticsearchF.java file inside the org.elasticsearch.bootstrap package.

2) Right Click -> Run Configs ...

3) In the window that appears, click the "Arguments" tab and in the "Program parameters:" section specify the value as the beginning and in the "VM parameters:" section specify the value as -Des.path.home = {path to your elasticsearch database root folder} / core -Des.security.manager.enabled = false



4) Click Apply and click Run.

Now it starts up. to check go to localhost: 9200 and you will get a message something like

 {
  "name" : "Raza",
  "cluster_name" : "elasticsearch",
  "version" : {
    "number" : "2.0.0-beta1",
    "build_hash" : "${buildNumber}",
    "build_timestamp" : "NA",
    "build_snapshot" : true,
    "lucene_version" : "5.2.1"
  },
  "tagline" : "You Know, for Search"
}

      

for more information on arguments see https://github.com/elastic/elasticsearch/commit/2b9ef26006c0e4608110164480b8127dffb9d6ad

+3


source


Edit your debug / run configurations, put them in vm arguments:

-Des.path.home = C: \ GitHub \ elasticsearch \



change C: \ github \ elasticsearch \ to your elasticsearch root path.

the reason is that some arguments in elasticsearch.bat are missing when you debug / run it in eclipse

0


source







All Articles