logstash-plugins / logstash-filter-jdbc_streaming

A Logstash filter that can enrich events with data from a database
Apache License 2.0
12 stars 23 forks source link

Unable to load plugin #27

Closed Nayar closed 5 years ago

Nayar commented 5 years ago

[ERROR] 2019-05-08 05:51:21.572 [[main]-pipeline-manager] javapipeline - Pipeline aborted due to error {:pipeline_id=>"main", :exception=>#<TypeError: failed to coerce jdk.internal.loader.ClassLoaders$AppClassLoader to java.net.URLClassLoader>, :backtrace=>["org/jruby/java/addons/KernelJavaAddons.java:29:into_java'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-filter-jdbc_streaming-1.0.5/lib/logstash/plugin_mixins/jdbc_streaming.rb:48:in prepare_jdbc_connection'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-filter-jdbc_streaming-1.0.5/lib/logstash/filters/jdbc_streaming.rb:194:inprepare_connected_jdbc_cache'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-filter-jdbc_streaming-1.0.5/lib/logstash/filters/jdbc_streaming.rb:116:in register'", "org/logstash/config/ir/compiler/AbstractFilterDelegatorExt.java:56:inregister'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:191:in block in register_plugins'", "org/jruby/RubyArray.java:1792:ineach'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:190:in register_plugins'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:446:inmaybe_setup_out_plugins'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:203:in start_workers'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:145:inrun'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:104:in block in start'"], :thread=>"#<Thread:0x7e04c1ec run>"} [ERROR] 2019-05-08 05:51:21.597 [Converge PipelineAction::Create<main>] agent - Failed to execute action {:id=>:main, :action_type=>LogStash::ConvergeResult::FailedAction, :message=>"Could not execute action: PipelineAction::Create<main>, action_result: false", :backtrace=>nil}

My config are as follows

filter {
    json {
        source => "message"
    }

    grok {
        match => {
            "topic" => "tele/%{DATA:mac_address}/SENSOR"
        }
    }

    jdbc_streaming {
        jdbc_connection_string => "jdbc:mysql://10.243.252.61:3306/mydb"
        jdbc_driver_library => "/root/mysql-connector-java-5.1.46/mysql-connector-java-5.1.46-bin.jar"
        jdbc_driver_class => "com.mysql.jdbc.Driver"
        jdbc_user => "mydb"
        jdbc_password => "mydb"
        statement => "SELECT email FROM chargingstation LEFT JOIN auth_user ON chargingstation.owner_id = auth_user.id  where mac_address=:mac_address1"
        parameters => { "mac_address1" => "mac_address" }
        target => "email"
    }
}
Nayar commented 5 years ago

Downgraded to openjdk 8 from openjdk 11. Works now.

KOSSOKO commented 5 years ago

Hi @Nayar We are facing the same issue, we downgrade the openjdk version by modifying the dockerfile and set the java path but we still have the same issue. How did you do to downgrade the openjdk ?