Closed jordansissel closed 6 years ago
% sed -ne "$(grep "Caused by:" /tmp/x | fex :-1 | sed -e 's/$/p;/' | fmt)" src/test/java/org/logstash/filters/DateFilterTest.java | sort | uniq -c
10 Event event = new Event();
Event class is not found at runtime, but at compile-time it is.
% rm Gemfile.lock gradle.properties; LOGSTASH_BRANCH=6.0 ci/build.sh
This works:
% rm Gemfile.lock gradle.properties; bundle install; bundle exec rake vendor; ./gradlew test
Because I think it targets Logstash 5.5.1 by accident.
this works when logstash source is v5.6.4
% rm Gemfile.lock gradle.properties; LOGSTASH_PATH=../logstash LOGSTASH_SOURCE=1 bundle install; bundle exec rake vendor; ./gradlew test
It looks like the actual class it can not find is :
org/jruby/RubyHash$VisitorWithState
java.lang.NoClassDefFoundError: org/jruby/RubyHash$VisitorWithState
at org.logstash.Event.<init>(Event.java:46)
It appears that since Event object is compiled against JRuby 9k (6.x+) ,but this plugin has a compile time dependency against JRuby 1.7, so when trying to create a new Event it passes compile time checks just fine, but at runtime the JRuby transitive dependencies to Event effectively gets swapping out at runtime, and boom.
Bumping the dependency to JRuby 9k will fix the issue for the 6.x branch of code, and as long we aren't using any 9k should also work for the 5.x code.
In very brief testing compiling this plugin against JRuby 9k and running 5.6 (using JRuby 1.7) it worked...however, it is risky enough to warrant a major version bump in the plugin (and not including it in future versions 5.x versions). Also, I don't plan to pin since we are only releasing patch versions for 5.x and shouldn't include majors dependency bumps in patch releases.