Trying to debug in Intellij

(Jonathan Aaron) #1

I found in the [testing documentation] (

That you can run gradle in the command line(intellij gradle plugin is not working for me, even on gradle 2.13) so I ran gradle run --debug-jvm Then I create a Remote in Intellij's Run/Debug Configurations and target port 8000 on localhost:

UPDATE but still Unresolved:
I'm getting around the path.home error by downloading elasticsearch and setting -Des.path.home to that directory. It's pretty hacky and I don't know how to get around it. What does everyone else set it too(es devs)?

I'm also adding all of the jars from that elasticsearch/lib/* to the classpath to get it to run. This is also hacky.

If you're an elasticsearch developer what does your configurations settings look like to run this project locally?

Original Post:
I would like to debug elasticsearch from Intellij. Spin up a node, put a breakpoint in, connect with kibana/java, add some data and see what happens. When I try to run I get some errors which I've pasted below. How should I have my local environment setup and what env variables are needed? Thanks for any help.

Exception in thread "main" java.lang.IllegalStateException: path.home is not configured
	at org.elasticsearch.env.Environment.<init>(
	at org.elasticsearch.node.internal.InternalSettingsPreparer.prepareEnvironment(
	at org.elasticsearch.bootstrap.Bootstrap.initialEnvironment(
	at org.elasticsearch.bootstrap.Bootstrap.init(
	at org.elasticsearch.bootstrap.Elasticsearch.init(
	at org.elasticsearch.bootstrap.Elasticsearch.execute(
	at org.elasticsearch.cli.SettingCommand.execute(
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(
	at org.elasticsearch.cli.Command.main(
	at org.elasticsearch.bootstrap.Elasticsearch.main(


2016-12-02 15:32:23,743 main ERROR Could not register mbeans access denied ("" "register")
	at java.lang.SecurityManager.checkPermission(
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.checkMBeanTrustPermission(
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(
	at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(
	at org.apache.logging.log4j.core.jmx.Server.register(
	at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(
	at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(
	at org.apache.logging.log4j.core.LoggerContext.setConfiguration(
	at org.apache.logging.log4j.core.LoggerContext.start(
	at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(
	at org.apache.logging.log4j.core.config.Configurator.initialize(
	at org.apache.logging.log4j.core.config.Configurator.initialize(
	at org.elasticsearch.common.logging.LogConfigurator.configureStatusLogger(
	at org.elasticsearch.common.logging.LogConfigurator.configureWithoutConfig(
	at org.elasticsearch.cli.Command.main(
	at org.elasticsearch.bootstrap.Elasticsearch.main(

Edit: The AccessControlException has been solved with one of these environment variables:

-Xms2g -Xmx2g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -server -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j.skipJansi=true -XX:+HeapDumpOnOutOfMemoryError

Still having the es.path.home issue.

(Alexander Reelsen) #2


the Settings you are creating to need to have a path.home variable configured - either by using a settings class or by pointing to a specific config file.

You might want to check out the tests in Elasticsearch itself to see how a node is started in there. However it might also just be enough to increase the logging? Not exactly sure what you are trying to do, so hard to comment.


(Jonathan Aaron) #3

Thanks for responding. I'm justing trying to start up the elasticsearch project in Intellij. I'm interested in how it get's it's requests and how it sends out those requests to other nodes. I'll check the test project and see if I can grab some settings from that. Have you ever started up Elasticsearch project in an IDE like IntelliJ or Eclipse?

(system) #4

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