Getting errors while running tests for plugin

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.

I have a website and I want to change the appearance, but the java code is creating an issue and it is giving errors. Can anyone help me in fixing this issue? I am not an expert of coding for the development of a website, due to which I am facing this issue and the person who helps me to write an essay for Paper Writing Service knows a little bit of coding; so he tried to help me. But the issue is not solved, so I need help for it.

Changing this line in gemspec worked for me..

-s.add_development_dependency "logstash-devutils", 
+s.add_development_dependency "logstash-devutils", "~> 1.3", ">= 1.3.1"

I got a similar mistake when attempting to introduce blog stash-yield email on logstash 5.1.1: A blunder happened while introducing logstash-center occasion java, and Bundler can't proceed. Ensure that dissertation editing online succeeds before bundling.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.