elastic / elastic/logstash

Conflicting jar versions can cause plugins not to work properly

Open
#3,153 9 comments 0 reactions 1 assignee Claimed by @purbon View on GitHub
bug discuss
Dominant language
Java
Stars
14.9k
Forks
3.5k
Avg merge
19h 14m
Merged PRs (30d)
63

Description

Raised becuase of a conflict with lucene versions between elasticsearch and neo4j, the test raised the situation where having two conflicting versions cause the plugins not to register.

To reproduce this issue:

1.- Install logstash-input-neo4j.
2.- Install logstash-output-elasticsearch.
3.- Add development dependencies.
4.- Run the plugin test.

then you will get an error like:

```
Failures:

1) outputs/elasticsearch registration should register
Failure/Error: expect {output.register}.to_not raise_error
expected no Exception, got java.lang.NoSuchFieldError: LUCENE_3_6 with backtrace:
# org.elasticsearch.Version.(org/elasticsearch/Version.java:43)
# org.elasticsearch.client.transport.TransportClient.(org/elasticsearch/client/transport/TransportClient.java:168)
# org.elasticsearch.client.transport.TransportClient.(org/elasticsearch/client/transport/TransportClient.java:123)
# java.lang.reflect.Constructor.newInstance(java/lang/reflect/Constructor.java:526)
# RUBY.(root)(./rakelib/test.rake:38)
# ./rakelib/test.rake:38:in `(root)'

Finished in 0.967 seconds
21 examples, 1 failure
```

but if for example you install the logstash-output-neo4j and the logstash-output-elasticsearch, the neo4j plugin output an error as it can has a conflict with the lucene version.

lucene jars being used are:

```
.//bundle/jruby/1.9/gems/logstash-output-elasticsearch-0.2.4-java/vendor/jar-dependencies/runtime-jars/lucene-core-4.10.4.jar
.//bundle/jruby/1.9/gems/neo4j-community-2.0.1/lib/neo4j-community/jars/lucene-core-3.6.2.jar
```

This happen now with Lucene, but I guess it can happen with other dependencies alike in the feature too.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.