# Logstash filter plugin - Missing class name

**URL:** <https://discuss.elastic.co/t/logstash-filter-plugin-missing-class-name/80631>\
**Category:** Logstash\
**Created:** [March 30, 2017, 8:35am UTC](https://discuss.elastic.co/t/logstash-filter-plugin-missing-class-name/80631 "2017-03-30T08:35:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Conall\_Prendergast](https://avatars.discourse-cdn.com/v4/letter/c/d26b3c/32.png) [@Conall\_Prendergast](https://discuss.elastic.co/u/Conall_Prendergast)\
**Post date:** [March 30, 2017, 8:35am UTC](https://discuss.elastic.co/t/logstash-filter-plugin-missing-class-name/80631/1 "2017-03-30T08:35:00Z")

</div>

Hi,

I am trying to convert a logstash 2.4 plugin to be compatible with 5.x. I made the necessary updates and when I run "rspec", I get the below error.

```
NameError: missing class name (`org.apache.logging.log4j.Level')
  get_proxy_or_package_under_package at org/jruby/javasupport/JavaUtilities.java:54
                  method_missing at file:/usr/local/rvm/rubies/jruby-1.7.26/lib/jruby.jar!/jruby/java/java_package_module_template.rb:14
                         Logging at /usr/local/rvm/gems/jruby-1.7.26/gems/logstash-core-5.2.1-java/lib/logstash/logging/logger.rb:6
                        LogStash at /usr/local/rvm/gems/jruby-1.7.26/gems/logstash-core-5.2.1-java/lib/logstash/logging/logger.rb:5
                          (root) at /usr/local/rvm/gems/jruby-1.7.26/gems/logstash-core-5.2.1-java/lib/logstash/logging/logger.rb:4
                         require at org/jruby/RubyKernel.java:1040
                          (root) at /usr/local/rvm/gems/jruby-1.7.26/gems/logstash-core-5.2.1-java/lib/logstash/logging.rb:1
                         require at org/jruby/RubyKernel.java:1040
                          (root) at /usr/local/rvm/gems/jruby-1.7.26/gems/logstash-core-5.2.1-java/lib/logstash/logging.rb:2
                         require at org/jruby/RubyKernel.java:1040
                          (root) at /usr/local/rvm/gems/jruby-1.7.26/gems/logstash-devutils-0.0.13-java/lib/logstash/devutils/rspec/spec_helper.rb:1
                         require at org/jruby/RubyKernel.java:1040
                          (root) at /usr/local/rvm/gems/jruby-1.7.26/gems/logstash-devutils-0.0.13-java/lib/logstash/devutils/rspec/spec_helper.rb:15
                            each at org/jruby/RubyArray.java:1613
                          (root) at /root/logstash-filter-geotag/spec/spec_helper.rb:1
                          (root) at /root/logstash-filter-geotag/spec/spec_helper.rb:1
                          (root) at /usr/local/rvm/gems/jruby-1.7.26/gems/rspec-core-2.14.8/lib/rspec/core/configuration.rb:1
     setup_load_path_and_require at /usr/local/rvm/gems/jruby-1.7.26/gems/rspec-core-2.14.8/lib/rspec/core/configuration.rb:867
     setup_load_path_and_require at /usr/local/rvm/gems/jruby-1.7.26/gems/rspec-core-2.14.8/lib/rspec/core/configuration.rb:867

```

It appears that it is failing on a "java\_import org.apache.logging.log4j.Level" line in the logging module.

The thing is, I can successfully run the tests in another plugin that was originally designed for LS5, but backported to 2.4.

What is causing this and how can I fix it?

Thanks,  
Conall

---

<div class="post-metadata">

**Author:** ![pierhugues](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pierhugues/32/48383_2.png) [@pierhugues](https://discuss.elastic.co/u/pierhugues)\
**Post date:** [March 31, 2017, 1:43pm UTC](https://discuss.elastic.co/t/logstash-filter-plugin-missing-class-name/80631/2 "2017-03-31T13:43:43Z")

</div>

Hello,  
From the error, I believe the spec\_helper in your project is missing a require.

Can you check if the first line in your spec\_helper is this line? If its not can you add it?

require "logstash/devutils/rspec/spec\_helper"

The other think I can think of is the dependency on the core is not correctly set, can you paste the content of your `*.gemspec` here?

Thanks

---

<div class="post-metadata">

**Author:** ![Conall\_Prendergast](https://avatars.discourse-cdn.com/v4/letter/c/d26b3c/32.png) [@Conall\_Prendergast](https://discuss.elastic.co/u/Conall_Prendergast)\
**Post date:** [March 31, 2017, 10:33pm UTC](https://discuss.elastic.co/t/logstash-filter-plugin-missing-class-name/80631/3 "2017-03-31T22:33:56Z")

</div>

Hi @pierhugues,

That require was in fact missing, and it has fixed my issue.

Many thanks,  
Conall

---

<div class="post-metadata">

**Author:** ![pierhugues](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pierhugues/32/48383_2.png) [@pierhugues](https://discuss.elastic.co/u/pierhugues)\
**Post date:** [April 7, 2017, 1:18pm UTC](https://discuss.elastic.co/t/logstash-filter-plugin-missing-class-name/80631/4 "2017-04-07T13:18:23Z")

</div>


