Elasticstart can't start on Deepin 15.3, java.lang.NoClassDefFoundError jackson/dataformat/yaml/snakeyaml/error/YAMLException

Hi,

I'm trying to run elasticsearch (fresh install) on Deepin 15.3 but it seems it stuck. Here is the error log:

Exception in thread "main" java.lang.NoClassDefFoundError: org/elasticsearch/common/jackson/dataformat/yaml/snakeyaml/error/YAMLException
at org.elasticsearch.common.jackson.dataformat.yaml.YAMLFactory._createParser(YAMLFactory.java:426)
at org.elasticsearch.common.jackson.dataformat.yaml.YAMLFactory.createParser(YAMLFactory.java:327)
at org.elasticsearch.common.xcontent.yaml.YamlXContent.createParser(YamlXContent.java:90)
at org.elasticsearch.common.settings.loader.XContentSettingsLoader.load(XContentSettingsLoader.java:45)
at org.elasticsearch.common.settings.loader.YamlSettingsLoader.load(YamlSettingsLoader.java:46)
at org.elasticsearch.common.settings.ImmutableSettings$Builder.loadFromStream(ImmutableSettings.java:982)
at org.elasticsearch.common.settings.ImmutableSettings$Builder.loadFromUrl(ImmutableSettings.java:969)
at org.elasticsearch.node.internal.InternalSettingsPreparer.prepareSettings(InternalSettingsPreparer.java:110)
at org.elasticsearch.bootstrap.Bootstrap.initialSettings(Bootstrap.java:144)
at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:215)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:32)
Caused by: java.lang.ClassNotFoundException: org.elasticsearch.common.jackson.dataformat.yaml.snakeyaml.error.YAMLException
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 11 more

I'm using "/usr/lib/jvm/java-8-openjdk-amd64/", and when I run:

java -verbose:class -cp elasticsearch-1.7.6.jar:lucene-core-4.10.4.jar org.elasticsearch.Version

the result is: Error: Could not find or load main class org.elasticsearch.Version

I have read other similar topics which seems like old problems (2014-2016) and tried several solutions but to no avail.

Is there any working solution for this problem on Deepin 15.3?

Hey very welcome in the community.

At first the statement, that everything in your version is way unsupported or old like:
Elasticsearch 1.7.6
https://www.elastic.co/support/eol
Deepin 15.3 - this OS in general is not support officially
https://www.elastic.co/de/support/matrix

I understand that you downloaded Elasticsearch 1.7.6
http://www.elastic.co/downloads/past-releases/elasticsearch-1.7.6

So first - why do you want to install such old version?

Apart from that I did test your version call:

java -verbose:class -cp elasticsearch-1.7.6.jar:lucene-core-4.10.4.jar org.elasticsearch.Version

The error

Error: Could not find or load main class org.elasticsearch.Version

happens when you aren't in the correct library path where the jar files are located, so please change there at first, assuming you installed the deb package:

cd /usr/share/elasticsearch/lib

If you've downloaded the tar.gz just go to the lib directory.

Please still give a bit detail how you started elasticsearch.

In case you installed the deb package you can start it by
/etc/init.d/elasticsearch start
and under /var/log/elasticsearch/elasticsearch.log you will find the logfile.

At the moment I don't where your Exception is coming from but seems that you tried to install it from wrong directory and back then default directory still was not under /etc but under installation path in directory config.

if Elasticsearch is start you can always do a curl localhost:9200 and Elasticsearch should answer with some version information.

Hope that helps.

1 Like

Hi Andre,

Thanks for pointing me out that I installed the old version.. I didn't realised it since I install the software using apt-get.

After installed the version 7.1 from .deb package, I still got an exception when running the elasticsearch:

I started elasticsearch by running:

sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
sudo systemctl start elasticsearch.service

it's active when checked using: sudo /bin/systemctl status elasticsearch.service

but I still cannot access it from localhost:9200, so I tried running it directly..

febrifahmi@djamansusah:~$ /usr/share/elasticsearch/bin/elasticsearch
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=gasp
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=gasp
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=gasp
Exception in thread "main" java.nio.file.AccessDeniedException: /etc/elasticsearch/jvm.options
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:219)
at java.base/java.nio.file.Files.newByteChannel(Files.java:373)
at java.base/java.nio.file.Files.newByteChannel(Files.java:424)
at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:420)
at java.base/java.nio.file.Files.newInputStream(Files.java:158)
at org.elasticsearch.tools.launchers.JvmOptionsParser.main(JvmOptionsParser.java:60)

and another error:

febrifahmi@djamansusah:~$ /usr/share/elasticsearch/bin/elasticsearch
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=gasp
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=gasp
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=gasp
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=gasp
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Could not rename log file '/var/log/elasticsearch/gc.log' to '/var/log/elasticsearch/gc.log.00' (Permission denied).
[0.000s][error][logging] Error opening log file '/var/log/elasticsearch/gc.log': Permission denied
[0.000s][error][logging] Initialization of output 'file=/var/log/elasticsearch/gc.log' using options 'filecount=32,filesize=64m' failed.
Invalid -Xlog option '-Xlog:gc*,gc+age=trace,safepoint:file=/var/log/elasticsearch/gc.log:utctime,pid,tags:filecount=32,filesize=64m', see error log for details.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Should I chmod the /etc/elasticsearch/ directory to make it accessible?

Thanks..

You would be better off running things via the Elasticsearch user itself if you can.

Hi,

The problem is solved after i checked the elastic.log file and uncomment the 'cluster.initial_master_nodes' setting.

Elasticsearch is now running on my Deepin 15.3.

Thanks. :slight_smile:

Regards

Ok great, that's good news.

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