Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run elasticsearch - Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.elasticsearch.Version #2989

Closed
lucabelluccini opened this issue May 4, 2013 · 17 comments
Assignees

Comments

@lucabelluccini
Copy link
Contributor

I got an error using elasticsearch 0.90.0

I am unable to run it using elasticsearch sh script.

Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.elasticsearch.Version
at org.elasticsearch.bootstrap.Bootstrap.buildErrorMessage(Bootstrap.java:251)
at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:235)
at org.elasticsearch.bootstrap.ElasticSearch.main(ElasticSearch.java:32)

@s1monw
Copy link
Contributor

s1monw commented May 4, 2013

Can you explain what you are doing exactly? I mean are you downloading the 0.90 release from here: http://www.elasticsearch.org/download/

and then unzip / untar and run bin/elasticsearch -f ?

@lucabelluccini
Copy link
Contributor Author

Exactly...
I have no root access (I am on my dev account on my company and I cannot ask for it for the moment).

22:56 lbelluccini@xxxxxx ~/tmp> java -version 10:56PM
java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b04)
Java HotSpot(TM) Server VM (build 22.1-b02, mixed mode)

I tried to printout the ES_CLASSPATH and ES_HOME and they are correctly set by the script itself...

Linux xxxxxx 2.6.32.23-0.3-default #1 SMP 2010-10-07 14:57:45 +0200 x86_64 x86_64 x86_64 GNU/Linux

@klausbrunner
Copy link

I got exactly the same error when using the official .deb (upgrade from 0.20.5 to 0.90.0), on Ubuntu 13.04 64bit and Oracle JDK 7u21.

I then apt-get purged the old installation, re-installed 0.90 from scratch, and everything worked fine. I didn't investigate any further, but I would suspect either a problem with the existing elasticsearch.yml, or with an existing native script that I referenced there (which of course was compiled against 0.20.x). HTH.

@lucabelluccini
Copy link
Contributor Author

Unfortunately I have no right to modify my system...

@spinscale
Copy link
Contributor

@klausbrunner I guess you do not have a way to reproduce your problem? Did you use plugins, which maybe included some more jars (even an old es installation maybe)?

@lucabelluccini have you maybe unzipped your elasticsearch zip file into an existing elasticsearch installation and then tried to start? Can you set the log level to TRACE in your logging.yml and check if you are getting more data logged, so we can debug this issue?

@lucabelluccini
Copy link
Contributor Author

@spinscale I downloaded and untarred both 0.20 and 0.90 in different paths.
I got 2 different errors.

19:51 lbelluccini@nxxxxxxxx ~/repos/pi_stats/elasticsearch-0.90.0> Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.elasticsearch.Version 7:51PM
at org.elasticsearch.bootstrap.Bootstrap.buildErrorMessage(Bootstrap.java:251)
at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:235)
at org.elasticsearch.bootstrap.ElasticSearch.main(ElasticSearch.java:32)

19:52 lbelluccini@nxxxxxxxx ~/repos/pi_stats/elasticsearch-0.20.6> ./bin/elasticsearch -f 7:52PM
May 08, 2013 7:52:56 PM node
INFO: [Grasshopper I&II] {0.20.6}[19688]: initializing ...
May 08, 2013 7:52:56 PM plugins
INFO: [Grasshopper I&II] loaded [], sites []
May 08, 2013 7:52:56 PM bootstrap
SEVERE: {0.20.6}: Initialization Failed ...

  • NoClassDefFoundError[org/apache/lucene/store/IndexInput]
    ClassNotFoundException[org.apache.lucene.store.IndexInput]

@klausbrunner
Copy link

@spinscale Yep, a plugin was also involved (phonetic). I can't easily reproduce this now, but it seems likely that either the plugin or the native script may have been the culprit, as both had been built for 0.20.x.

@spinscale
Copy link
Contributor

@lucabelluccini can you show me all the commands (including the wget to download the archive) you executed in order to get your elasticsearch versions and to start elasticsearch. It doesnt like you downloaded the zip or the tar.gz distribution, otherwise I cannot explain why you lack lucene jars when starting elasticsearch.

@ghost ghost assigned spinscale May 10, 2013
@lucabelluccini
Copy link
Contributor Author

wget http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.0.tar.gz
tar xvfz elasticsearch-0.90.0.tar.gz
cd elasticsearch-0.90.0
./bin/elasticsearch -f

I did the same on my unix vm and it worked...
I tried to print out es classpath etc... and it contains the jars...

@spinscale
Copy link
Contributor

Ok, this is getting even more strange.

To what is your JAVA_HOME set?
What is the difference between your unix VM and the system you are trying to install on? It is a standard linux, right?

@kimchy
Copy link
Member

kimchy commented May 10, 2013

Also would be interseting to see an export of all env vars.

@lucabelluccini
Copy link
Contributor Author

lucabelluccini commented May 13, 2013

Linux version 2.6.16.60-0.76.8-smp (geeko@buildhost) (gcc version 4.1.2 20070115 (SUSE Linux)) #1 SMP Tue Jan 11 11:23:59 UTC 2011

No JAVA_HOME set.

java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b04)
Java HotSpot(TM) Server VM (build 22.1-b02, mixed mode)

/nastools/java/bin/java

MAIL=/var/mail/lbelluccini
SHELL=/usr/bin/zsh

SSH_TTY=/dev/pts/2
TERM=xterm
CDC_JOINED_ZO

PS1=%{%}%T %{%}%n%{%}@%{%}%m %{%}%~%{%}>%{%}
RPS1=%t
DIRSTACKSIZE=50
HISTSIZE=1000
HISTFILE=/remote/users3/lbellucc/.zsh_history
SAVEHIST=500
TMPDIR=/gctmp/lbelluccini
FCEDIT=vi
EDITOR=vi
TZ=MET
TERMINFO=/usr/share/terminfo
MERCURIAL_VERSION=2.2.3
MERCURIAL_BASE=/opt/devsup/mercurial
MERCURIAL_PYTHONPATH=/opt/devsup/mercurial/mercurial-2.2.3/lib/python2.6/site-packages
PYTHONPATH=/remote/projects1/intscs/delivery/python2.6/lib/python2.6/site-packages:/projects/seidelde/ConfigTools::/opt/devsup/platinum/:/opt/devsup/mercurial/mercurial-1.6/lib/python
PLATINUM_CLIENT_HOME=/opt/devsup/platinum
POLONIUM_HOME=/opt/devsup/polonium
LD_RUN_PATH=/opt/gcc/lib::/nastools/fuse/lib:/nastools/sles10/valgrind/lib
KDEDIR=/nastools/sles10/kcachegrind
CSX_HOSTTYPE=Linux
CSX_HOSTREL=2.6.16.60-0.76.8-smp
TRACECONFIGPATH=.
CVS_RSH=remsh
CVS_SERVER=/usr/local/bin/cvs
CVSROOT=:pserver:ncedom+lbelluccini@ncecvsgco:/cvsgco/csxdev
stable=/remote/projects1/cplint/stable
staging=/remote/projects1/cplint/work
reference=/remote/projects1/cplint/reference
MERCURIAL_WORKING_DIR=/remote/users3/lbellucc/cpl
CONFMAKER_VERSION=latest
DISABLE_HUGETLBFS=1
TNS_ADMIN=/nastools/oracle/etc
TWO_TASK=DB10C11ls

PHASE=unit_dev

CCACHE_DIR=/mwrep/ccache
CCACHE_NOLINK=1
CCACHE_UMASK=000
CCACHE_UNIFY=1
CSX_BMS=1
BMS_TARGET=sCxx64MtDbg
CSX_OTF=1
CSP_OTF=1
CPC_OTF=1
GREP_OPTIONS=--color=auto
CSX_USE_CH=1
OTF_VERSION=2-6-0-19
MW_PACK_VERSION=1-7a-1-23
CSX_USE_MWREPLICATION=1
NLS_LANG=AMERICAN_AMERICA.UTF8
WORKSPACE=cpl
SCS_PACKAGE_VERSION=1.28
OTF_PORT_RANGE=200
_=/usr/bin/env

@spinscale
Copy link
Contributor

Hey, judging from your setup I have one more assumption (and slowly but surely being more sure this is a administration setup preventing elasticsearch from starting).

Has your system administrator have any additional security tools like SELinux or AppArmor running?
Judging from your settings, is it possible that your home directory is a network share? Any additional possibilities, that this share is not allowed to execute or open certain files (again by security policy maybe?) or that executing programs may not open files on that share?

Wild guesses from the distance... maybe having one of sysadmins jump in may help to clear things up a bit with this setup.

@lucabelluccini
Copy link
Contributor Author

Hello... I am quite sure LinuxSe is active.
And yes, I am on a network mounted home.
I'll try later from the machine drive.

Confirmed!

Outside from the NAS works correctly.

[2013-05-14 09:11:15,600][INFO ][node ] [Aged Genghis] {0.90.0}[30251]: initializing ...
[2013-05-14 09:11:15,605][INFO ][plugins ] [Aged Genghis] loaded [], sites []
[2013-05-14 09:11:17,314][INFO ][node ] [Aged Genghis] {0.90.0}[30251]: initialized
[2013-05-14 09:11:17,314][INFO ][node ] [Aged Genghis] {0.90.0}[30251]: starting ...
[2013-05-14 09:11:17,449][INFO ][transport ] [Aged Genghis] bound_address {inet[/0:0:0:0:0:0:0:0:9301]}, publish_address {inet[/172.16.136.244:9301]}
[2013-05-14 09:11:22,086][INFO ][node ] [Aged Genghis] {0.90.0}[30251]: stopping ...
[2013-05-14 09:11:22,100][INFO ][node ] [Aged Genghis] {0.90.0}[30251]: stopped
[2013-05-14 09:11:22,100][INFO ][node ] [Aged Genghis] {0.90.0}[30251]: closing ...
[2013-05-14 09:11:22,108][INFO ][node ] [Aged Genghis] {0.90.0}[30251]: closed

@spinscale
Copy link
Contributor

Closing this issue then. Not an elasticsearch issue.

Still important to keep in mind, that running security hardening tools might be an issue in order to get elasticsearch up and running.

Thanks a lot for your patience and ongoing information delivery!

@lucabelluccini
Copy link
Contributor Author

Thank you for the support! Great job.

@JoseFMP
Copy link

JoseFMP commented Sep 4, 2017

I am still experiencing this issue...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants