Build from source but NoClassDefFoundError:ExtendedPluginsClassLoader

(Golmic) #1

Elasticsearch version (bin/elasticsearch --version):

Version: 6.2.4

Plugins installed: []


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 and unzip
  2. cd && gradle idea
  3. brew install elasticsearch
  4. and download

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

in idea,


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

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( ~[main/:?]
	at org.elasticsearch.plugins.PluginsService.loadBundles( ~[main/:?]
	at org.elasticsearch.plugins.PluginsService.<init>( ~[main/:?]
	at org.elasticsearch.node.Node.<init>( ~[main/:?]
	at org.elasticsearch.node.Node.<init>( ~[main/:?]
	at org.elasticsearch.bootstrap.Bootstrap$5.<init>( ~[main/:?]
	at org.elasticsearch.bootstrap.Bootstrap.setup( ~[main/:?]
	at org.elasticsearch.bootstrap.Bootstrap.init( ~[main/:?]
	at org.elasticsearch.bootstrap.Elasticsearch.init( ~[main/:?]
	at org.elasticsearch.bootstrap.Elasticsearch.execute( ~[main/:?]
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute( ~[main/:?]
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling( ~[main/:?]
	at org.elasticsearch.cli.Command.main( ~[main/:?]
	at org.elasticsearch.bootstrap.Elasticsearch.main( ~[main/:?]
	at org.elasticsearch.bootstrap.Elasticsearch.main( ~[main/:?]
Caused by: java.lang.ClassNotFoundException: org.elasticsearch.plugins.ExtendedPluginsClassLoader
	at jdk.internal.loader.BuiltinClassLoader.loadClass( ~[?:?]
	at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass( ~[?:?]
	at java.lang.ClassLoader.loadClass( ~[?:?]
	... 15 more

(Golmic) #2

please help me

(Ryan Ernst) #3

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/

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.

(Golmic) #4

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.

(Ryan Ernst) #5

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.

(system) #6

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