Fix Derby missed driver classes when built locally for version 10.15.
What does this PR do?
Adds missed Derby jars that contain part of the driver, in particular derbytools jar.
copy the missed jars into the local_repository for vendoring
remove usage of old jdbc-derby gems that bundled old Derby driver which made the tests works in the past and hidden the bug of not adding all the Derby jars properly.
Expose the Derby version in a file which can be reused both from Gradle and Rspec test
Why is it important/What is the impact to the user?
Permit to the user to effectively use the locally built Derby driver.
Checklist
[x] My code follows the style guidelines of this project
[x] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[ ] I have made corresponding change to the default configuration files (and/or docker env variables)
[ ] I have added tests that prove my fix is effective or that my feature works
5. Verify that it works while fails without this PR.
## Related issues
<!-- Recommended
Link related issues below. Insert the issue link or reference after the word "Closes" if merging this should automatically close it.
- Closes #123
- Relates #123
- Requires #123
- Superseeds #123
-->
- Closes #159
## Logs
[2024-03-14T17:03:09,983][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.
[2024-03-14T17:03:09,988][INFO ][logstash.filters.jdbcstatic][main] derby.system.home is: /Users/andrea/workspace/logstash_andsel/data/plugins/shared/derby_home
[2024-03-14T17:03:10,150][ERROR][logstash.javapipeline ][main] Pipeline error {:pipeline_id=>"main", :exception=>#, :backtrace=>["/Users/andrea/workspace/logstash_andsel/vendor/bundle/jruby/3.1.0/gems/sequel-5.78.0/lib/sequel/adapters/jdbc.rb:66:in load_driver'", "/Users/andrea/workspace/logstash_andsel/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.8/lib/logstash/filters/jdbc/basic_database.rb:98:inverify_connection'", "/Users/andrea/workspace/logstash_andsel/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.8/lib/logstash/filters/jdbc/read_write_database.rb:58:in post_create'", "/Users/andrea/workspace/logstash_andsel/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.8/lib/logstash/filters/jdbc/basic_database.rb:33:increate'", "/Users/andrea/workspace/logstash_andsel/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.8/lib/logstash/filters/jdbc/lookup_processor.rb:36:in initialize'", "org/jruby/RubyClass.java:935:innew'", "/Users/andrea/workspace/logstash_andsel/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.8/lib/logstash/filters/jdbc_static.rb:207:in prepare_runner'", "/Users/andrea/workspace/logstash_andsel/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.8/lib/logstash/filters/jdbc_static.rb:158:inregister'", "org/logstash/config/ir/compiler/AbstractFilterDelegatorExt.java:75:in register'", "/Users/andrea/workspace/logstash_andsel/logstash-core/lib/logstash/java_pipeline.rb:237:inblock in register_plugins'", "org/jruby/RubyArray.java:1983:in each'", "/Users/andrea/workspace/logstash_andsel/logstash-core/lib/logstash/java_pipeline.rb:236:inregister_plugins'", "/Users/andrea/workspace/logstash_andsel/logstash-core/lib/logstash/java_pipeline.rb:611:in maybe_setup_out_plugins'", "/Users/andrea/workspace/logstash_andsel/logstash-core/lib/logstash/java_pipeline.rb:249:instart_workers'", "/Users/andrea/workspace/logstash_andsel/logstash-core/lib/logstash/java_pipeline.rb:194:in run'", "/Users/andrea/workspace/logstash_andsel/logstash-core/lib/logstash/java_pipeline.rb:146:inblock in start'"], "pipeline.sources"=>["/Users/andrea/workspace/logstash_configs/jdbc/mysql_pipeline_filter.conf"], :thread=>"#<Thread:0x6c547cce /Users/andrea/workspace/logstash_andsel/logstash-core/lib/logstash/java_pipeline.rb:134 run>"}
[2024-03-14T17:03:10,151][INFO ][logstash.javapipeline ][main] Pipeline terminated {"pipeline.id"=>"main"}
[2024-03-14T17:03:10,166][ERROR][logstash.agent ] Failed to execute action {:id=>:main, :action_type=>LogStash::ConvergeResult::FailedAction, :message=>"Could not execute action: PipelineAction::Create, action_result: false", :backtrace=>nil}
[2024-03-14T17:03:10,170][INFO ][logstash.runner ] Logstash shut down.
[2024-03-14T17:03:10,171][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:912) ~[jruby.jar:?]
at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:871) ~[jruby.jar:?]
at Users.andrea.workspace.logstash_andsel.lib.bootstrap.environment.(/Users/andrea/workspace/logstash_andsel/lib/bootstrap/environment.rb:90) ~[?:?]
Release notes
Fix Derby missed driver classes when built locally for version 10.15.
What does this PR do?
Adds missed Derby jars that contain part of the driver, in particular
derbytools
jar.local_repository
for vendoringjdbc-derby
gems that bundled old Derby driver which made the tests works in the past and hidden the bug of not adding all the Derby jars properly.Why is it important/What is the impact to the user?
Permit to the user to effectively use the locally built Derby driver.
Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files (and/or docker env variables)[ ] I have added tests that prove my fix is effective or that my feature worksAuthor's Checklist
How to test this PR locally
Gemfile
addingand run
filter { jdbc_static { jdbc_driver_library => "/path/to/mysql-connector-java-8.0.26.jar" jdbc_driver_class => "Java::com.mysql.cj.jdbc.Driver" jdbc_connection_string => "jdbc:mysql://localhost:3306/test_logstash"
} }
output { stdout { codec => "rubydebug" } }
[2024-03-14T17:03:09,983][INFO ][logstash.javapipeline ] Pipeline, :backtrace=>["/Users/andrea/workspace/logstash_andsel/vendor/bundle/jruby/3.1.0/gems/sequel-5.78.0/lib/sequel/adapters/jdbc.rb:66:in , action_result: false", :backtrace=>nil}
[2024-03-14T17:03:10,170][INFO ][logstash.runner ] Logstash shut down.
[2024-03-14T17:03:10,171][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:912) ~[jruby.jar:?]
at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:871) ~[jruby.jar:?]
at Users.andrea.workspace.logstash_andsel.lib.bootstrap.environment.(/Users/andrea/workspace/logstash_andsel/lib/bootstrap/environment.rb:90) ~[?:?]
main
is configured withpipeline.ecs_compatibility: v8
setting. All plugins in this pipeline will default toecs_compatibility => v8
unless explicitly configured otherwise. [2024-03-14T17:03:09,988][INFO ][logstash.filters.jdbcstatic][main] derby.system.home is: /Users/andrea/workspace/logstash_andsel/data/plugins/shared/derby_home [2024-03-14T17:03:10,150][ERROR][logstash.javapipeline ][main] Pipeline error {:pipeline_id=>"main", :exception=>#load_driver'", "/Users/andrea/workspace/logstash_andsel/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.8/lib/logstash/filters/jdbc/basic_database.rb:98:in
verify_connection'", "/Users/andrea/workspace/logstash_andsel/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.8/lib/logstash/filters/jdbc/read_write_database.rb:58:inpost_create'", "/Users/andrea/workspace/logstash_andsel/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.8/lib/logstash/filters/jdbc/basic_database.rb:33:in
create'", "/Users/andrea/workspace/logstash_andsel/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.8/lib/logstash/filters/jdbc/lookup_processor.rb:36:ininitialize'", "org/jruby/RubyClass.java:935:in
new'", "/Users/andrea/workspace/logstash_andsel/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.8/lib/logstash/filters/jdbc_static.rb:207:inprepare_runner'", "/Users/andrea/workspace/logstash_andsel/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.8/lib/logstash/filters/jdbc_static.rb:158:in
register'", "org/logstash/config/ir/compiler/AbstractFilterDelegatorExt.java:75:inregister'", "/Users/andrea/workspace/logstash_andsel/logstash-core/lib/logstash/java_pipeline.rb:237:in
block in register_plugins'", "org/jruby/RubyArray.java:1983:ineach'", "/Users/andrea/workspace/logstash_andsel/logstash-core/lib/logstash/java_pipeline.rb:236:in
register_plugins'", "/Users/andrea/workspace/logstash_andsel/logstash-core/lib/logstash/java_pipeline.rb:611:inmaybe_setup_out_plugins'", "/Users/andrea/workspace/logstash_andsel/logstash-core/lib/logstash/java_pipeline.rb:249:in
start_workers'", "/Users/andrea/workspace/logstash_andsel/logstash-core/lib/logstash/java_pipeline.rb:194:inrun'", "/Users/andrea/workspace/logstash_andsel/logstash-core/lib/logstash/java_pipeline.rb:146:in
block in start'"], "pipeline.sources"=>["/Users/andrea/workspace/logstash_configs/jdbc/mysql_pipeline_filter.conf"], :thread=>"#<Thread:0x6c547cce /Users/andrea/workspace/logstash_andsel/logstash-core/lib/logstash/java_pipeline.rb:134 run>"} [2024-03-14T17:03:10,151][INFO ][logstash.javapipeline ][main] Pipeline terminated {"pipeline.id"=>"main"} [2024-03-14T17:03:10,166][ERROR][logstash.agent ] Failed to execute action {:id=>:main, :action_type=>LogStash::ConvergeResult::FailedAction, :message=>"Could not execute action: PipelineAction::Create