Exception in thread "main" java.lang.NoClassDefFoundError: org/elasticsearch/xpack/XPackPlugin
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.(PreBuiltXPackTransportClient.java:50)
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.(PreBuiltXPackTransportClient.java:46)
at com.ef.elastics.elastic.main(elastic.java:29)
Caused by: java.lang.ClassNotFoundException: org.elasticsearch.xpack.XPackPlugin
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)
... 3 more
yes i do follow the steps as explained in the documentation: https://www.elastic.co/guide/en/x-pack/current/api-java.html
when i try to download the maven repo it says artifact missing id, so i download x-pack transport manually and insert it in my java project but now i have this problem says class not found exception. I trying to do indexing using java api client since i install x-pack it needs authentication.
I have fixed my repository problem now i have different error:
Exception in thread "main" java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.elasticsearch.plugins.PluginsService.loadPlugin(PluginsService.java:451)
at org.elasticsearch.plugins.PluginsService.(PluginsService.java:116)
at org.elasticsearch.client.transport.TransportClient.newPluginService(TransportClient.java:81)
at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.java:106)
at org.elasticsearch.client.transport.TransportClient.(TransportClient.java:228)
at org.elasticsearch.transport.client.PreBuiltTransportClient.(PreBuiltTransportClient.java:69)
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.(PreBuiltXPackTransportClient.java:50)
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.(PreBuiltXPackTransportClient.java:46)
at com.ef.elastics.elastic.main(elastic.java:35)
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: com.unboundid.util.Debug
at org.elasticsearch.xpack.XPackPlugin$1.run(XPackPlugin.java:144)
at org.elasticsearch.xpack.XPackPlugin$1.run(XPackPlugin.java:138)
at java.security.AccessController.doPrivileged(Native Method)
at org.elasticsearch.xpack.XPackPlugin.(XPackPlugin.java:138)
... 13 more
can you make sure, that you are also downloading and using transitive dependencies of the x-pack client. Running mvn dependency:tree will show you those for example. It seems, those are missing.
ava.lang.NoClassDefFoundError: org/elasticsearch/xpack/XPackPlugin
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.<init>(PreBuiltXPackTransportClient.java:50)
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.<init>(PreBuiltXPackTransportClient.java:46)
Please open new issues instead of appending to old issues, that have been resolved.
This looks as if the dependency you specified could not be downloaded. Did you specify the additional repository as mentioned at the documentation you linked?
How does your pom.xml/gradle.build file look like?
java.lang.NoClassDefFoundError: org/elasticsearch/xpack/XPackPlugin
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.<init>(PreBuiltXPackTransportClient.java:55)
You didn't follow the instructions correctly, and you need to try them again - the #1 thing people miss is that you need to add the elasticsearch-releases repository to your pom.xml.
You have an internal repository manager (nexus, artifactory, etc) that hasn't been configured correctly. If that's the case then you need to talk to whoever administers your repository manager, there's not a lot we can do to diagnose the problem.
@lukasSirhal1 May be you did not declare correctly the elasticsearch repo in artifactory?
https://artifacts.elastic.co/maven is where artifacts are stored. IIRC there is a specific option which basically tries to list files in the repo which is not supported. So you have to uncheck that option (don't remember the name).
If you are still having troubles, share in a new thread how you configured artifactory.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.