Homebrew / Lion NoClassDefFoundError

Hi,

I'm using ElasticSearch on Lion for quite some time now, but was stuck with release 0.17.7. That one worked great with Homebrew's default formula. Today I upgraded to 0.18.6, but can't get it to work. The problem I run into is that the main class could not be found. I performed the following upgrade steps:
$ brew upgrade elasticsearch
$ launchctl unload -w ~/Library/LaunchAgents/org.elasticsearch.plist
$ ln -nfs /usr/local/Cellar/elasticsearch/0.18.6/org.elasticsearch.plist ~/Library/LaunchAgents/
$ launchctl load -wF ~/Library/LaunchAgents/org.elasticsearch.plist

The elasticsearch daemon won't start. When trying to start it manually, I get a NoClassDefFoundError
$ elasticsearch -f -D es.config=/usr/local/Cellar/elasticsearch/0.18.6/config/elasticsearch.yml
Exception in thread "main" java.lang.NoClassDefFoundError: org/elasticsearch/bootstrap/ElasticSearch
Caused by: java.lang.ClassNotFoundException: org.elasticsearch.bootstrap.ElasticSearch
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

I read some more problems with the scripts related to the plugins, but not related to ES itself. Does anyone know what might be the problem with my environment? I use the following java version:
$ java -version
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11M3527)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)

Thanks, Jasper

hi
i think that you should set path.home="${elasticsearch_home}" in config file.

    1. 16., 오전 8:08, Jasper van Wanrooy - Chatventure 작성:

Hi,

I'm using Elasticsearch on Lion for quite some time now, but was stuck with release 0.17.7. That one worked great with Homebrew's default formula. Today I upgraded to 0.18.6, but can't get it to work. The problem I run into is that the main class could not be found. I performed the following upgrade steps:
$ brew upgrade elasticsearc
$ launchctl unload -w ~/Library/LaunchAgents/org.elasticsearch.plist
$ ln -nfs /usr/local/Cellar/elasticsearch/0.18.6/org.elasticsearch.plist ~/Library/LaunchAgents/
$ launchctl load -wF ~/Library/LaunchAgents/org.elasticsearch.plist

The elasticsearch daemon won't start. When trying to start it manually, I get a NoClassDefFoundError
$ elasticsearch -f -D es.config=/usr/local/Cellar/elasticsearch/0.18.6/config/elasticsearch.yml
Exception in thread "main" java.lang.NoClassDefFoundError: org/elasticsearch/bootstrap/Elasticsearch
Caused by: java.lang.ClassNotFoundException: org.elasticsearch.bootstrap.Elasticsearch
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

I read some more problems with the scripts related to the plugins, but not related to ES itself. Does anyone know what might be the problem with my environment? I use the following java version:
$ java -version
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11M3527)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)

Thanks, Jasper

Hi David,

Thanks for your help. I added it to the path section in the config, but unfortunately it didn't work out. Is it possible that my environment variables are incorrectly configured? Which one do I need to take a look at?

Thanks, Jasper

On 16 jan. 2012, at 01:28, David.Woo@nexr.com wrote:

hi
i think that you should set path.home="${elasticsearch_home}" in config file.

    1. 16., 오전 8:08, Jasper van Wanrooy - Chatventure 작성:

Hi,

I'm using Elasticsearch on Lion for quite some time now, but was stuck with release 0.17.7. That one worked great with Homebrew's default formula. Today I upgraded to 0.18.6, but can't get it to work. The problem I run into is that the main class could not be found. I performed the following upgrade steps:
$ brew upgrade elasticsearc
$ launchctl unload -w ~/Library/LaunchAgents/org.elasticsearch.plist
$ ln -nfs /usr/local/Cellar/elasticsearch/0.18.6/org.elasticsearch.plist ~/Library/LaunchAgents/
$ launchctl load -wF ~/Library/LaunchAgents/org.elasticsearch.plist

The elasticsearch daemon won't start. When trying to start it manually, I get a NoClassDefFoundError
$ elasticsearch -f -D es.config=/usr/local/Cellar/elasticsearch/0.18.6/config/elasticsearch.yml
Exception in thread "main" java.lang.NoClassDefFoundError: org/elasticsearch/bootstrap/Elasticsearch
Caused by: java.lang.ClassNotFoundException: org.elasticsearch.bootstrap.Elasticsearch
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

I read some more problems with the scripts related to the plugins, but not related to ES itself. Does anyone know what might be the problem with my environment? I use the following java version:
$ java -version
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11M3527)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)

Thanks, Jasper

ok.

first of all.

check your Elasticsearch Lib Directory

Is it Empty or not? (except sigar directory)

when is lib directory empty that you should to build Elasticsearch use gradle.

When you use elasticsearch from source, you can't executed the script and start it.
You need to build a distribution of elasticsearch and then use it.

Execute "gradlew release" and you will find the distribution under build/distribution.

    1. 16., 오후 8:06, Jasper van Wanrooy - Chatventure 작성:

Hi David,

Thanks for your help. I added it to the path section in the config, but unfortunately it didn't work out. Is it possible that my environment variables are incorrectly configured? Which one do I need to take a look at?

Thanks, Jasper

On 16 jan. 2012, at 01:28, David.Woo@nexr.com wrote:

hi
i think that you should set path.home="${elasticsearch_home}" in config file.

    1. 16., 오전 8:08, Jasper van Wanrooy - Chatventure 작성:

Hi,

I'm using Elasticsearch on Lion for quite some time now, but was stuck with release 0.17.7. That one worked great with Homebrew's default formula. Today I upgraded to 0.18.6, but can't get it to work. The problem I run into is that the main class could not be found. I performed the following upgrade steps:
$ brew upgrade elasticsearc
$ launchctl unload -w ~/Library/LaunchAgents/org.elasticsearch.plist
$ ln -nfs /usr/local/Cellar/elasticsearch/0.18.6/org.elasticsearch.plist ~/Library/LaunchAgents/
$ launchctl load -wF ~/Library/LaunchAgents/org.elasticsearch.plist

The elasticsearch daemon won't start. When trying to start it manually, I get a NoClassDefFoundError
$ elasticsearch -f -D es.config=/usr/local/Cellar/elasticsearch/0.18.6/config/elasticsearch.yml
Exception in thread "main" java.lang.NoClassDefFoundError: org/elasticsearch/bootstrap/Elasticsearch
Caused by: java.lang.ClassNotFoundException: org.elasticsearch.bootstrap.Elasticsearch
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

I read some more problems with the scripts related to the plugins, but not related to ES itself. Does anyone know what might be the problem with my environment? I use the following java version:
$ java -version
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11M3527)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)

Thanks, Jasper

Thanks for your help!
The problem was that the formula for elasticsearch has changed over time. The locations for the libs changed bacause of Homebrew conventions. I had an old .elasticsearch.in.sh file in my home directory with a reference to the old ES_HOME. After removing all old stuff it works as expected again.

Thanks, Jasper

On 16 jan. 2012, at 15:07, David.Woo@nexr.com wrote:

ok.

first of all.

check your Elasticsearch Lib Directory

Is it Empty or not? (except sigar directory)

when is lib directory empty that you should to build Elasticsearch use gradle.

When you use elasticsearch from source, you can't executed the script and start it.
You need to build a distribution of elasticsearch and then use it.

Execute "gradlew release" and you will find the distribution under build/distribution.

    1. 16., 오후 8:06, Jasper van Wanrooy - Chatventure 작성:

Hi David,

Thanks for your help. I added it to the path section in the config, but unfortunately it didn't work out. Is it possible that my environment variables are incorrectly configured? Which one do I need to take a look at?

Thanks, Jasper

On 16 jan. 2012, at 01:28, David.Woo@nexr.com wrote:

hi
i think that you should set path.home="${elasticsearch_home}" in config file.

    1. 16., 오전 8:08, Jasper van Wanrooy - Chatventure 작성:

Hi,

I'm using Elasticsearch on Lion for quite some time now, but was stuck with release 0.17.7. That one worked great with Homebrew's default formula. Today I upgraded to 0.18.6, but can't get it to work. The problem I run into is that the main class could not be found. I performed the following upgrade steps:
$ brew upgrade elasticsearc
$ launchctl unload -w ~/Library/LaunchAgents/org.elasticsearch.plist
$ ln -nfs /usr/local/Cellar/elasticsearch/0.18.6/org.elasticsearch.plist ~/Library/LaunchAgents/
$ launchctl load -wF ~/Library/LaunchAgents/org.elasticsearch.plist

The elasticsearch daemon won't start. When trying to start it manually, I get a NoClassDefFoundError
$ elasticsearch -f -D es.config=/usr/local/Cellar/elasticsearch/0.18.6/config/elasticsearch.yml
Exception in thread "main" java.lang.NoClassDefFoundError: org/elasticsearch/bootstrap/Elasticsearch
Caused by: java.lang.ClassNotFoundException: org.elasticsearch.bootstrap.Elasticsearch
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

I read some more problems with the scripts related to the plugins, but not related to ES itself. Does anyone know what might be the problem with my environment? I use the following java version:
$ java -version
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11M3527)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)

Thanks, Jasper