Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on loading drupal_dblog #9

Open
jordansissel opened this issue May 18, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@jordansissel
Copy link
Contributor

commented May 18, 2015

(This issue was originally filed by @anoopl at https://github.com/elastic/logstash-contrib/issues/105)


on Logstash version 1.4.2 installed using yum repo

While using drupal_dblog I get this error:

The error reported is:
cannot load Java class com.mysql.jdbc.Driver

IRB output:

/opt/logstash/bin/logstash irb
irb(main):001:0> require "jdbc/mysql"
=> true

irb(main):005:0> require "java"
=> false
irb(main):006:0> java_import "com.mysql.jdbc.Driver"
NameError: cannot load Java class com.mysql.jdbc.Driver

@alexfd

This comment has been minimized.

Copy link

commented Jun 23, 2015

Hi, same problem for same plugin, on logstash-1.5.1.

org/jruby/javasupport/JavaClass.java:204:in `for_name'
org/jruby/javasupport/JavaUtilities.java:34:in `get_proxy_class'
file:/usr/src/logstash-1.5.1/vendor/jruby/lib/jruby.jar!/jruby/java/core_ext/object.rb:27:in `java_import'
org/jruby/RubyArray.java:2412:in `map'
file:/usr/src/logstash-1.5.1/vendor/jruby/lib/jruby.jar!/jruby/java/core_ext/object.rb:22:in `java_import'
/usr/src/logstash-1.5.1/vendor/bundle/jruby/1.9/gems/logstash-input-drupal_dblog-0.1.7-java/lib/logstash/inputs/drupal_dblog/jdbcconnection.rb:6:in `(root)'
org/jruby/RubyKernel.java:1072:in `require'
/usr/src/logstash-1.5.1/vendor/bundle/jruby/1.9/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/usr/src/logstash-1.5.1/vendor/bundle/jruby/1.9/gems/logstash-input-drupal_dblog-0.1.7-java/lib/logstash/inputs/drupal_dblog.rb:1:in `(root)'
/usr/src/logstash-1.5.1/vendor/bundle/jruby/1.9/gems/logstash-input-drupal_dblog-0.1.7-java/lib/logstash/inputs/drupal_dblog.rb:64:in `register'
org/jruby/RubyArray.java:1613:in `each'
/usr/src/logstash-1.5.1/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.1-java/lib/logstash/pipeline.rb:148:in `start_inputs'
/usr/src/logstash-1.5.1/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.1-java/lib/logstash/pipeline.rb:147:in `start_inputs'
org/jruby/ext/thread/Mutex.java:149:in `synchronize'
/usr/src/logstash-1.5.1/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.1-java/lib/logstash/pipeline.rb:80:in `run'
/usr/src/logstash-1.5.1/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.1-java/lib/logstash/pipeline.rb:80:in `run'
/usr/src/logstash-1.5.1/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.1-java/lib/logstash/agent.rb:150:in `execute'
org/jruby/RubyProc.java:271:in `call'
/usr/src/logstash-1.5.1/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.1-java/lib/logstash/runner.rb:87:in `run'
org/jruby/RubyProc.java:271:in `call'
/usr/src/logstash-1.5.1/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.1-java/lib/logstash/runner.rb:92:in `run'
  cannot load Java class com.mysql.jdbc.Driver

I have mysql-connector-java-5.1.35-bin.jar available in the logstash jruby dir.

# logstash-1.5.1/bin/logstash irb
1.9 :001 > require "jdbc/mysql"
 => true
@alexfd

This comment has been minimized.

Copy link

commented Jun 29, 2015

Answer found in https://botbot.me/freenode/logstash/2014-09-09/?msg=21297125&page=5 (conversation between anoopl and electrical).
Solution is to add

require "/usr/src/logstash-1.5.1/vendor/bundle/jruby/1.9/gems/jdbc-mysql-5.1.35/lib/mysql-connector-java-5.1.35-bin.jar"

in
/usr/src/logstash-1.5.1/vendor/bundle/jruby/1.9/gems/logstash-input-drupal_dblog-0.1.7-java/lib/logstash/inputs/drupal_dblog.rb

Obviously use your own paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.