Hi All,
I am trying to write tests for my logstash plugin. When I try to run rspec, this is what I get
bundle exec rspec
NameError: missing class name (`org.apache.logging.log4j.Level')
method_missing at org/jruby/javasupport/JavaPackage.java:261
<module:Logging> at /Users/madhav.kelkar/.rvm/gems/jruby-9.1.6.0/gems/logstash-core-5.1.1.1-java/lib/logstash/logging/logger.rb:6
<module:LogStash> at /Users/madhav.kelkar/.rvm/gems/jruby-9.1.6.0/gems/logstash-core-5.1.1.1-java/lib/logstash/logging/logger.rb:5
<main> at /Users/madhav.kelkar/.rvm/gems/jruby-9.1.6.0/gems/logstash-core-5.1.1.1-java/lib/logstash/logging/logger.rb:4
require at org/jruby/RubyKernel.java:959
<main> at /Users/madhav.kelkar/.rvm/gems/jruby-9.1.6.0/gems/logstash-core-5.1.1.1-java/lib/logstash/logging.rb:1
require at org/jruby/RubyKernel.java:959
<main> at /Users/madhav.kelkar/.rvm/gems/jruby-9.1.6.0/gems/logstash-core-5.1.1.1-java/lib/logstash/logging.rb:2
require at org/jruby/RubyKernel.java:959
<main> at /Users/madhav.kelkar/.rvm/gems/jruby-9.1.6.0/gems/logstash-devutils-1.1.0-java/lib/logstash/devutils/rspec/spec_helper.rb:1
load at org/jruby/RubyKernel.java:977
block in (root) at /Users/madhav.kelkar/.rvm/gems/jruby-9.1.6.0/gems/logstash-devutils-1.1.0-java/lib/logstash/devutils/rspec/spec_helper.rb:15
each at org/jruby/RubyArray.java:1734
(root) at /Users/madhav.kelkar/work/logstash-input-es_indexer/spec/inputs/es_indexer_spec.rb:1
(root) at /Users/madhav.kelkar/work/logstash-input-es_indexer/spec/inputs/es_indexer_spec.rb:2
(root) at /Users/madhav.kelkar/.rvm/gems/jruby-9.1.6.0/gems/rspec-core-3.5.4/lib/rspec/core/configuration.rb:1
load_spec_files at /Users/madhav.kelkar/.rvm/gems/jruby-9.1.6.0/gems/rspec-core-3.5.4/lib/rspec/core/configuration.rb:1435
load_spec_files at /Users/madhav.kelkar/.rvm/gems/jruby-9.1.6.0/gems/rspec-core-3.5.4/lib/rspec/core/configuration.rb:1433
<main> at /Users/madhav.kelkar/.rvm/gems/jruby-9.1.6.0/gems/rspec-core-3.5.4/lib/rspec/core/runner.rb:100
load at org/jruby/RubyKernel.java:977
<eval> at /Users/madhav.kelkar/.rvm/gems/jruby-9.1.6.0/gems/rspec-core-3.5.4/lib/rspec/core/runner.rb:86
eval at org/jruby/RubyKernel.java:998
<main> at /Users/madhav.kelkar/.rvm/gems/jruby-9.1.6.0/bin/jruby_executable_hooks:15
Here is my gemspec -
# Special flag to let us know this is actually a logstash plugin
s.metadata = { "logstash_plugin" => "true", "logstash_group" => "input" }
# Gem dependencies
s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99"
s.add_runtime_dependency 'logstash-codec-plain', "3.0.2"
s.add_runtime_dependency 'stud', '0.0.22'
s.add_development_dependency 'logstash-devutils', '1.1.0'
l did some research, and looks like there was indeed a problem - https://github.com/elastic/logstash/issues/6374
Looks like latest available logstash-core-plugin-api (2.1.22) is using logstash-core 5.1.1.1. My theory is that if a version of logstash-core-plugin-api becomes available which uses logstash-core 5.1.2/5.2.0, my error should go way if I use that version. Can someone confirm this? is there a workaround for errors that I am getting?
Thanks,
Madhav.