Mariadb-java-client-3.2.0.jar never found

I'm on Windows 11. Elastic Search is in D:\ES. Logstash is in D:\LS.

In D:\LS is ls.conf:

input {
  jdbc {
    jdbc_driver_library => "D:/LS/mariadb-java-client-3.2.0.jar"
    jdbc_driver_class => "org.mariadb.jdbc.Driver"
    jdbc_connection_string => "jdbc:mysql://localhost:3306/cattitude"
    jdbc_user => "***"
    jdbc_password => "***"
    statement => "SELECT * FROM loek_van_kooten_engdut"
  }
}

output {
  elasticsearch {
    hosts => ["https://localhost:9200"]
    user => "elastic"
    password => "***"
    ssl => true
    ssl_certificate_verification => false
  }
}

In D:\LS is also mariadb-java-client-3.2.0.jar

Despite all that, this gives:

D:\LS>bin\logstash -f ls.conf
"Using bundled JDK: D:\LS\jdk\bin\java.exe"
Sending Logstash logs to D:/LS/logs which is now configured via log4j2.properties
[2023-10-03T23:27:49,767][INFO ][logstash.runner          ] Log4j configuration path used is: D:\LS\config\log4j2.properties
[2023-10-03T23:27:49,769][INFO ][logstash.runner          ] Starting Logstash {"logstash.version"=>"8.10.2", "jruby.version"=>"jruby 9.4.2.0 (3.1.0) 2023-03-08 90d2913fda OpenJDK 64-Bit Server VM 17.0.8+7 on 17.0.8+7 +indy +jit [x86_64-mswin32]"}
[2023-10-03T23:27:49,770][INFO ][logstash.runner          ] JVM bootstrap flags: [-Xms1g, -Xmx1g, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djruby.compile.invokedynamic=true, -XX:+HeapDumpOnOutOfMemoryError, -Djava.security.egd=file:/dev/urandom, -Dlog4j2.isThreadContextMapInheritable=true, -Djruby.regexp.interruptible=true, -Djdk.io.File.enableADS=true, --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED, --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED, --add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED, --add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED, --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED, --add-opens=java.base/java.security=ALL-UNNAMED, --add-opens=java.base/java.io=ALL-UNNAMED, --add-opens=java.base/java.nio.channels=ALL-UNNAMED, --add-opens=java.base/sun.nio.ch=ALL-UNNAMED, --add-opens=java.management/sun.management=ALL-UNNAMED]
[2023-10-03T23:27:49,810][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2023-10-03T23:27:50,944][INFO ][logstash.agent           ] Successfully started Logstash API endpoint {:port=>9600, :ssl_enabled=>false}
[2023-10-03T23:27:51,187][INFO ][org.reflections.Reflections] Reflections took 92 ms to scan 1 urls, producing 132 keys and 464 values
[2023-10-03T23:27:52,544][WARN ][logstash.outputs.elasticsearch] You are using a deprecated config setting "ssl_certificate_verification" set in elasticsearch. Deprecated settings will continue to work, but are scheduled for removal from logstash in the future. Set 'ssl_verification_mode' instead. If you have any questions about this, please visit the #logstash channel on freenode irc. {:name=>"ssl_certificate_verification", :plugin=><LogStash::Outputs::ElasticSearch ssl_certificate_verification=>false, password=><password>, id=>"2f161124061a305dbcd4dcbff6bc8609aa964de02022673db441217f6595cae6", user=>"elastic", ssl=>true, hosts=>[https://localhost:9200], enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_92849c20-4c83-44e8-9e82-7d92ea30512e", enable_metric=>true, charset=>"UTF-8">, workers=>1, ssl_verification_mode=>"full", sniffing=>false, sniffing_delay=>5, timeout=>60, pool_max=>1000, pool_max_per_route=>100, resurrect_delay=>5, validate_after_inactivity=>10000, http_compression=>false, retry_initial_interval=>2, retry_max_interval=>64, dlq_on_failed_indexname_interpolation=>true, data_stream_type=>"logs", data_stream_dataset=>"generic", data_stream_namespace=>"default", data_stream_sync_fields=>true, data_stream_auto_routing=>true, manage_template=>true, template_overwrite=>false, template_api=>"auto", doc_as_upsert=>false, script_type=>"inline", script_lang=>"painless", script_var_name=>"event", scripted_upsert=>false, retry_on_conflict=>1, ilm_enabled=>"auto", ilm_pattern=>"{now/d}-000001", ilm_policy=>"logstash-policy">}
[2023-10-03T23:27:52,546][WARN ][logstash.outputs.elasticsearch] You are using a deprecated config setting "ssl" set in elasticsearch. Deprecated settings will continue to work, but are scheduled for removal from logstash in the future. Set 'ssl_enabled' instead. If you have any questions about this, please visit the #logstash channel on freenode irc. {:name=>"ssl", :plugin=><LogStash::Outputs::ElasticSearch ssl_certificate_verification=>false, password=><password>, id=>"2f161124061a305dbcd4dcbff6bc8609aa964de02022673db441217f6595cae6", user=>"elastic", ssl=>true, hosts=>[https://localhost:9200], enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_92849c20-4c83-44e8-9e82-7d92ea30512e", enable_metric=>true, charset=>"UTF-8">, workers=>1, ssl_verification_mode=>"full", sniffing=>false, sniffing_delay=>5, timeout=>60, pool_max=>1000, pool_max_per_route=>100, resurrect_delay=>5, validate_after_inactivity=>10000, http_compression=>false, retry_initial_interval=>2, retry_max_interval=>64, dlq_on_failed_indexname_interpolation=>true, data_stream_type=>"logs", data_stream_dataset=>"generic", data_stream_namespace=>"default", data_stream_sync_fields=>true, data_stream_auto_routing=>true, manage_template=>true, template_overwrite=>false, template_api=>"auto", doc_as_upsert=>false, script_type=>"inline", script_lang=>"painless", script_var_name=>"event", scripted_upsert=>false, retry_on_conflict=>1, ilm_enabled=>"auto", ilm_pattern=>"{now/d}-000001", ilm_policy=>"logstash-policy">}
[2023-10-03T23:27:52,573][INFO ][logstash.javapipeline    ] Pipeline `main` is configured with `pipeline.ecs_compatibility: v8` setting. All plugins in this pipeline will default to `ecs_compatibility => v8` unless explicitly configured otherwise.
[2023-10-03T23:27:52,587][INFO ][logstash.outputs.elasticsearch][main] New Elasticsearch output {:class=>"LogStash::Outputs::ElasticSearch", :hosts=>["https://localhost:9200"]}
[2023-10-03T23:27:52,599][WARN ][logstash.outputs.elasticsearch][main] You have enabled encryption but DISABLED certificate verification, to make sure your data is secure set `ssl_verification_mode => full`
[2023-10-03T23:27:52,868][INFO ][logstash.outputs.elasticsearch][main] Elasticsearch pool URLs updated {:changes=>{:removed=>[], :added=>[https://elastic:xxxxxx@localhost:9200/]}}
[2023-10-03T23:27:53,051][WARN ][logstash.outputs.elasticsearch][main] Restored connection to ES instance {:url=>"https://elastic:xxxxxx@localhost:9200/"}
[2023-10-03T23:27:53,058][INFO ][logstash.outputs.elasticsearch][main] Elasticsearch version determined (8.10.2) {:es_version=>8}
[2023-10-03T23:27:53,058][WARN ][logstash.outputs.elasticsearch][main] Detected a 6.x and above cluster: the `type` event field won't be used to determine the document _type {:es_version=>8}
[2023-10-03T23:27:53,068][INFO ][logstash.outputs.elasticsearch][main] Data streams auto configuration (`data_stream => auto` or unset) resolved to `true`
[2023-10-03T23:27:53,080][INFO ][logstash.javapipeline    ][main] Starting pipeline {:pipeline_id=>"main", "pipeline.workers"=>20, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>50, "pipeline.max_inflight"=>2500, "pipeline.sources"=>["D:/LS/ls.conf"], :thread=>"#<Thread:0x4f589d58 D:/LS/logstash-core/lib/logstash/java_pipeline.rb:134 run>"}
[2023-10-03T23:27:54,051][INFO ][logstash.javapipeline    ][main] Pipeline Java execution initialization time {"seconds"=>0.97}
[2023-10-03T23:27:54,245][ERROR][logstash.inputs.jdbc     ][main] Unable to connect to database. Tried 1 times {:message=>"[\"com.mysql.cj.jdbc.Driver\", \"com.mysql.jdbc.Driver\"] not loaded, try installing jdbc-mysql gem", :exception=>Sequel::AdapterNotFound, :cause=>#<NameError: missing class name com.mysql.jdbc.Driver>, :backtrace=>["D:/LS/vendor/bundle/jruby/3.1.0/gems/sequel-5.71.0/lib/sequel/adapters/jdbc.rb:66:in `load_driver'", "D:/LS/vendor/bundle/jruby/3.1.0/gems/sequel-5.71.0/lib/sequel/adapters/jdbc/mysql.rb:5:in `<module:JDBC>'", "D:/LS/vendor/bundle/jruby/3.1.0/gems/sequel-5.71.0/lib/sequel/adapters/jdbc/mysql.rb:4:in `<module:Sequel>'", "D:/LS/vendor/bundle/jruby/3.1.0/gems/sequel-5.71.0/lib/sequel/adapters/jdbc/mysql.rb:3:in `<main>'", "org/jruby/RubyKernel.java:1057:in `require'", "D:/LS/vendor/bundle/jruby/3.1.0/gems/sequel-5.71.0/lib/sequel/database/connecting.rb:87:in `load_adapter'", "D:/LS/vendor/bundle/jruby/3.1.0/gems/sequel-5.71.0/lib/sequel/adapters/jdbc.rb:378:in `adapter_initialize'", "D:/LS/vendor/bundle/jruby/3.1.0/gems/sequel-5.71.0/lib/sequel/database/misc.rb:169:in `initialize'", "org/jruby/RubyClass.java:904:in `new'", "D:/LS/vendor/bundle/jruby/3.1.0/gems/sequel-5.71.0/lib/sequel/database/connecting.rb:57:in `connect'", "D:/LS/vendor/bundle/jruby/3.1.0/gems/sequel-5.71.0/lib/sequel/core.rb:124:in `connect'", "D:/LS/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.4/lib/logstash/plugin_mixins/jdbc/jdbc.rb:123:in `block in jdbc_connect'", "org/jruby/RubyKernel.java:1586:in `loop'", "D:/LS/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.4/lib/logstash/plugin_mixins/jdbc/jdbc.rb:120:in `jdbc_connect'", "D:/LS/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.4/lib/logstash/plugin_mixins/jdbc/jdbc.rb:163:in `open_jdbc_connection'", "D:/LS/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.4/lib/logstash/inputs/jdbc.rb:309:in `register'", "D:/LS/vendor/bundle/jruby/3.1.0/gems/logstash-mixin-ecs_compatibility_support-1.3.0-java/lib/logstash/plugin_mixins/ecs_compatibility_support/target_check.rb:48:in `register'", "D:/LS/logstash-core/lib/logstash/java_pipeline.rb:237:in `block in register_plugins'", "org/jruby/RubyArray.java:1987:in `each'", "D:/LS/logstash-core/lib/logstash/java_pipeline.rb:236:in `register_plugins'", "D:/LS/logstash-core/lib/logstash/java_pipeline.rb:395:in `start_inputs'", "D:/LS/logstash-core/lib/logstash/java_pipeline.rb:320:in `start_workers'", "D:/LS/logstash-core/lib/logstash/java_pipeline.rb:194:in `run'", "D:/LS/logstash-core/lib/logstash/java_pipeline.rb:146:in `block in start'"]}
[2023-10-03T23:27:55,070][ERROR][logstash.javapipeline    ][main] Pipeline error {:pipeline_id=>"main", :exception=>#<Sequel::AdapterNotFound: ["com.mysql.cj.jdbc.Driver", "com.mysql.jdbc.Driver"] not loaded, try installing jdbc-mysql gem>, :backtrace=>["D:/LS/vendor/bundle/jruby/3.1.0/gems/sequel-5.71.0/lib/sequel/adapters/jdbc.rb:66:in `load_driver'", "D:/LS/vendor/bundle/jruby/3.1.0/gems/sequel-5.71.0/lib/sequel/adapters/jdbc/mysql.rb:5:in `<module:JDBC>'", "D:/LS/vendor/bundle/jruby/3.1.0/gems/sequel-5.71.0/lib/sequel/adapters/jdbc/mysql.rb:4:in `<module:Sequel>'", "D:/LS/vendor/bundle/jruby/3.1.0/gems/sequel-5.71.0/lib/sequel/adapters/jdbc/mysql.rb:3:in `<main>'", "org/jruby/RubyKernel.java:1057:in `require'", "D:/LS/vendor/bundle/jruby/3.1.0/gems/sequel-5.71.0/lib/sequel/database/connecting.rb:87:in `load_adapter'", "D:/LS/vendor/bundle/jruby/3.1.0/gems/sequel-5.71.0/lib/sequel/adapters/jdbc.rb:378:in `adapter_initialize'", "D:/LS/vendor/bundle/jruby/3.1.0/gems/sequel-5.71.0/lib/sequel/database/misc.rb:169:in `initialize'", "org/jruby/RubyClass.java:904:in `new'", "D:/LS/vendor/bundle/jruby/3.1.0/gems/sequel-5.71.0/lib/sequel/database/connecting.rb:57:in `connect'", "D:/LS/vendor/bundle/jruby/3.1.0/gems/sequel-5.71.0/lib/sequel/core.rb:124:in `connect'", "D:/LS/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.4/lib/logstash/plugin_mixins/jdbc/jdbc.rb:123:in `block in jdbc_connect'", "org/jruby/RubyKernel.java:1586:in `loop'", "D:/LS/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.4/lib/logstash/plugin_mixins/jdbc/jdbc.rb:120:in `jdbc_connect'", "D:/LS/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.4/lib/logstash/plugin_mixins/jdbc/jdbc.rb:163:in `open_jdbc_connection'", "D:/LS/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.4/lib/logstash/inputs/jdbc.rb:309:in `register'", "D:/LS/vendor/bundle/jruby/3.1.0/gems/logstash-mixin-ecs_compatibility_support-1.3.0-java/lib/logstash/plugin_mixins/ecs_compatibility_support/target_check.rb:48:in `register'", "D:/LS/logstash-core/lib/logstash/java_pipeline.rb:237:in `block in register_plugins'", "org/jruby/RubyArray.java:1987:in `each'", "D:/LS/logstash-core/lib/logstash/java_pipeline.rb:236:in `register_plugins'", "D:/LS/logstash-core/lib/logstash/java_pipeline.rb:395:in `start_inputs'", "D:/LS/logstash-core/lib/logstash/java_pipeline.rb:320:in `start_workers'", "D:/LS/logstash-core/lib/logstash/java_pipeline.rb:194:in `run'", "D:/LS/logstash-core/lib/logstash/java_pipeline.rb:146:in `block in start'"], "pipeline.sources"=>["D:/LS/ls.conf"], :thread=>"#<Thread:0x4f589d58 D:/LS/logstash-core/lib/logstash/java_pipeline.rb:134 run>"}
[2023-10-03T23:27:55,071][INFO ][logstash.javapipeline    ][main] Pipeline terminated {"pipeline.id"=>"main"}
[2023-10-03T23:27:55,077][ERROR][logstash.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}
[2023-10-03T23:27:55,084][INFO ][logstash.runner          ] Logstash shut down.
[2023-10-03T23:27:55,087][FATAL][org.logstash.Logstash    ] Logstash stopped processing because of an error: (SystemExit) exit
org.jruby.exceptions.SystemExit: (SystemExit) exit
        at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:795) ~[jruby.jar:?]
        at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:758) ~[jruby.jar:?]
        at D_3a_.LS.lib.bootstrap.environment.<main>(D:\LS\lib\bootstrap\environment.rb:90) ~[?:?]

I have also tried D:\LS\mariadb-java-client-3.2.0.jar and just/ ariadb-java-client-3.2.0.jar

Nothing works. How come?

Also tried to move the jar to logstash-core\lib\jars and changing jdbc_driver_class => "org.mariadb.jdbc.Driver" to jdbc_driver_class => ""

No luck.

Solved with the following work-around. Logstash doesn't seem to like MariaDB.

jdbc_driver_library => "D:/LS/mysql-connector-j-8.1.0.jar"
jdbc_driver_class => "com.mysql.cj.jdbc.Driver"
1 Like

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