Build from source but NoClassDefFoundError:ExtendedPluginsClassLoader

Elasticsearch version (bin/elasticsearch --version):

Version: 6.2.4

Plugins installed: []

None

JVM version (java -version):

java version "10.0.1" 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)

OS version (uname -a if on a Unix-like system):

MacBook-Pro.local 17.5.0 Darwin Kernel Version 17.5.0

Description of the problem including expected versus actual behavior:

I want to build ES and debug.ES6.2.4

Steps to reproduce:

  1. download https://github.com/elastic/elasticsearch/archive/v6.2.4.zip and unzip
  2. cd && gradle idea
  3. brew install elasticsearch
  4. https://www.elastic.co/downloads/elasticsearch and download
    https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.4.zip

copy elasticsearch-6.2.4’s modules and plugins to /usr/local/var/elasticsearch

in idea,

-Des.path.conf=/usr/local/etc/elasticsearch/
-Des.path.home=/usr/local/var/elasticsearch/
-Dlog4j2.disable.jmx=true

run elasticsearch-6.2.4/server/src/main/java/org/elasticsearch/bootstrap/Elasticsearch.java

Provide logs (if relevant):

[2018-05-22T13:52:44,399][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [] fatal error in thread [main], exiting
java.lang.NoClassDefFoundError: org/elasticsearch/plugins/ExtendedPluginsClassLoader
	at org.elasticsearch.plugins.PluginsService.loadBundle(PluginsService.java:494) ~[main/:?]
	at org.elasticsearch.plugins.PluginsService.loadBundles(PluginsService.java:422) ~[main/:?]
	at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:146) ~[main/:?]
	at org.elasticsearch.node.Node.<init>(Node.java:303) ~[main/:?]
	at org.elasticsearch.node.Node.<init>(Node.java:246) ~[main/:?]
	at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:213) ~[main/:?]
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:213) ~[main/:?]
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:323) ~[main/:?]
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[main/:?]
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) ~[main/:?]
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[main/:?]
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[main/:?]
	at org.elasticsearch.cli.Command.main(Command.java:90) ~[main/:?]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[main/:?]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85) ~[main/:?]
Caused by: java.lang.ClassNotFoundException: org.elasticsearch.plugins.ExtendedPluginsClassLoader
	at jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582) ~[?:?]
	at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190) ~[?:?]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:499) ~[?:?]
	... 15 more

please help me

please help me

Please be patient.

You're steps to reproduce seem to be different ways of installing elasticsearch, but not actually a list of steps to run.

copy elasticsearch-6.2.4’s modules and plugins to /usr/local/var/elasticsearch

You should not modify the installation of elasticsearch. That can produce all kinds of weird errors.

run elasticsearch-6.2.4/server/src/main/java/org/elasticsearch/bootstrap/Elasticsearch.java

Are you trying to run the Elasticsearch class directly, not with bin/elasticsearch? If so, that is unsupported. Elasticsearch requires a very particular java setup, and the bin script sets up this environment (including classpath) as Elasticsearch expects.

Please give more detailed reproduction instructions.

hi! Thanks for reply.

What I want to do is debug the Elasticsearch, which means I want to follow the step to find out what Elasticsearch does when I index a document or search.
I use IntelliJ IDEA help me to do this.

Are you trying to run the Elasticsearch class directly, not with bin/elasticsearch

I don't know what should I do after runing gradle idea.

How to run the Elasticsearch class directly ?

Thank you very much.

For the stated purpose, it is best to checkout elasticsearch from GitHub. Once you have done this,
./gradlew idea is only initialized the IntelliJ project. You then need to follow the instructions in the CONTRIBUTING guide for importing the project into IntelliJ. You can then add a "Remote" debug configuration in IntelliJ, run elasticsearch from source and run the debug action in IntelliJ.
.

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