bells / elasticsearch-analysis-dynamic-synonym

The dynamic synonym plugin adds a synonym token filter that reloads the synonym file(local file or remote file) at given intervals (default 60s).
372 stars 182 forks source link

Null pointer exception on ES 5.2.0 #17

Open diamondio-ops opened 7 years ago

diamondio-ops commented 7 years ago

Is this supposed to work on Elasticsearch 5.2? I'm getting the following error:

        at com.bellszhu.elasticsearch.plugin.synonym.analysis.DynamicSynonymTokenFilterFactory.<init>(DynamicSynonymTokenFilterFactory.java:94) ~[?:?]
        at com.bellszhu.elasticsearch.plugin.DynamicSynonymPlugin$1.get(DynamicSynonymPlugin.java:68) ~[?:?]
        at com.bellszhu.elasticsearch.plugin.DynamicSynonymPlugin$1.get(DynamicSynonymPlugin.java:63) ~[?:?]
        at org.elasticsearch.index.analysis.AnalysisRegistry.buildMapping(AnalysisRegistry.java:342) ~[elasticsearch-5.2.0.jar:5.2.0]
        at org.elasticsearch.index.analysis.AnalysisRegistry.buildTokenFilterFactories(AnalysisRegistry.java:171) ~[elasticsearch-5.2.0.jar:5.2.0]
        at org.elasticsearch.index.analysis.AnalysisRegistry.build(AnalysisRegistry.java:155) ~[elasticsearch-5.2.0.jar:5.2.0]
        at org.elasticsearch.index.IndexService.<init>(IndexService.java:146) ~[elasticsearch-5.2.0.jar:5.2.0]
        at org.elasticsearch.index.IndexModule.newIndexService(IndexModule.java:363) ~[elasticsearch-5.2.0.jar:5.2.0]
        at org.elasticsearch.indices.IndicesService.createIndexService(IndicesService.java:425) ~[elasticsearch-5.2.0.jar:5.2.0]
        at org.elasticsearch.indices.IndicesService.createIndex(IndicesService.java:390) ~[elasticsearch-5.2.0.jar:5.2.0]
        at org.elasticsearch.cluster.metadata.MetaDataCreateIndexService$1.execute(MetaDataCreateIndexService.java:362) ~[elasticsearch-5.2.0.jar:5.2.0]
        at org.elasticsearch.cluster.ClusterStateUpdateTask.execute(ClusterStateUpdateTask.java:45) ~[elasticsearch-5.2.0.jar:5.2.0]
        at org.elasticsearch.cluster.service.ClusterService.executeTasks(ClusterService.java:674) ~[elasticsearch-5.2.0.jar:5.2.0]
        at org.elasticsearch.cluster.service.ClusterService.calculateTaskOutputs(ClusterService.java:653) ~[elasticsearch-5.2.0.jar:5.2.0]
        at org.elasticsearch.cluster.service.ClusterService.runTasks(ClusterService.java:612) [elasticsearch-5.2.0.jar:5.2.0]
        at org.elasticsearch.cluster.service.ClusterService$UpdateTask.run(ClusterService.java:1112) [elasticsearch-5.2.0.jar:5.2.0]
        at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:527) [elasticsearch-5.2.0.jar:5.2.0]
        at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:238) [elasticsearch-5.2.0.jar:5.2.0]
        at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:201) [elasticsearch-5.2.0.jar:5.2.0]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_102]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_102]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_102]
zealot128 commented 7 years ago

Just putting the plugin in a ES 5.2 server, doesn't work, ES quits with:

[2017-02-10T13:01:29,045][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [ci.pludoni.de] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: 
    Plugin [analysis-dynamic-synonym] is incompatible with Elasticsearch [5.2.0]. Was designed for version [5.1.1]

So, I've simply tried changing the version to 5.2.0. in pom.xml, but then compilation fails:

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /elasticsearch-analysis-dynamic-synonym/src/main/java/com/bellszhu/elasticsearch/plugin/DynamicSynonymPlugin.java:[40,4] 
    error: method does not override or implement a method from a supertype
[INFO] 1 error

Any ideas?

Shooting1007 commented 7 years ago

i hit the same problem .i recompiled for elasitcsearch5.3.0

wejick commented 7 years ago

should work with this PR #22

bjmajiancheng commented 7 years ago

i hit the same problem. Did you have resolve?