我们为ElasticSearch提供了一个基于Java的自定义插件。我们现在升级到ElasticSearch 2.1.1并添加了plugin-descriptor.properties文件以指向我们的插件类。
之后,我们就可以安装自定义插件了。但是当我们启动ElasticSearch服务时,它无法找到这个自定义插件。我们验证了类文件存在于/ usr / share / elasticsearch / plugins /目录下。
以下是异常堆栈跟踪:
[2016-01-20 13:13:48,527][ERROR][bootstrap] Exception
ElasticsearchException[Could not find plugin class [com.symc.edp.elasticsearch.plugin.CustomEDPPlugins]]; nested: ClassNotFoundException[com.symc.edp.elasticsearch.plugin.CustomEDPPlugins];
at org.elasticsearch.plugins.PluginsService.loadPluginClass(PluginsService.java:382)
at org.elasticsearch.plugins.PluginsService.loadBundles(PluginsService.java:348)
at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:109)
at org.elasticsearch.node.Node.<init>(Node.java:146)
at org.elasticsearch.node.Node.<init>(Node.java:128)
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:145)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:178)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:285)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Caused by: java.lang.ClassNotFoundException: com.symc.edp.elasticsearch.plugin.CustomEDPPlugins
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:814)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.elasticsearch.plugins.PluginsService.loadPluginClass(PluginsService.java:380)
... 8 more
[2016-01-20 13:22:55,236][INFO ][node ] [localhost] version[2.1.1], pid[20680], build[40e2c53/2015-12-15T13:05:55Z]
[2016-01-20 13:22:55,237][INFO ][node ] [localhost] initializing ...
[2016-01-20 13:22:55,840][ERROR][bootstrap ] Exception
ElasticsearchException[Could not find plugin class [com.symc.edp.elasticsearch.plugin.CustomEDPPlugins.class]]; nested: ClassNotFoundException[com.symc.edp.elasticsearch.plugin.CustomEDPPlugins.class];
at org.elasticsearch.plugins.PluginsService.loadPluginClass(PluginsService.java:382)
at org.elasticsearch.plugins.PluginsService.loadBundles(PluginsService.java:348)
at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:109)
at org.elasticsearch.node.Node.<init>(Node.java:146)
at org.elasticsearch.node.Node.<init>(Node.java:128)
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:145)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:178)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:285)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Caused by: java.lang.ClassNotFoundException: com.symc.edp.elasticsearch.plugin.CustomEDPPlugins.class
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:814)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.elasticsearch.plugins.PluginsService.loadPluginClass(PluginsService.java:380)
... 8 more
以下是我们的plugin-descriptor.properties
的内容description=EDP Custom Plugins
version=${project.version}
name=edpCustomPlugins
jvm=true
site=false
classname=com.symc.edp.elasticsearch.plugin.CustomEDPPlugins
java.version=${java.specification.version}
elasticsearch.version=2.1.1
答案 0 :(得分:2)
可能是您错误地打包了该插件。
也许您正在尝试使用已编译的类安装jar文件,而不是安装包含jar文件和plugin-descriptor.properties文件的zip文件。
答案 1 :(得分:0)
您确定您的班级名称应为com.symc.edp.elasticsearch.plugin.CustomEDPPlugins.class。最后这个类的部分看起来很奇怪。我猜你的类名是com.symc.edp.elasticsearch.plugin.CustomEDPPlugins。另一件事......你能打开你建立的jar文件,看看里面是否有类com.symc.edp.elasticsearch.plugin.CustomEDPPlugins?