Jdbc input plugin cannot load the driver class

I'm trying to fetch information from the internal metrics system of a data virtualization software Tibco TDV. The TDV admins published it as a JDBC-compliant database endpoint and provided me with the jar file and the class name they themselves use when polling that endpoint. However, Logstash does not seem to be able to load the class from the jar and use it.

I am aware of this issue, but I'm using logstash 7.5.1 which includes the already fixed jdbc input plugin.

The configuration I use is:

./logstash -e '
   input { 
       jdbc { jdbc_driver_library => "/tmp/csjdbc.jar" 
       jdbc_driver_class => "cs.jdbc.driver.CompositeDriver" 
       jdbc_connection_string => "jdbc:compositesw:dbapi@tdv-d.adeo.no:9401?domain=composite&dataSource=Plattform&encrypt=true" 
       jdbc_user => "logstash" 
      statement => "SELECT * FROM metrics_resources_usage"
    } 
}'

The error I'm getting is:

[ERROR] 2019-12-19 09:33:01.186 [[main]<jdbc] javapipeline - A plugin had an unrecoverable error. Will restart this plugin.
  Pipeline_id:main
  Plugin: <LogStash::Inputs::Jdbc jdbc_user=>"logstash", statement=>"SELECT * FROM metrics_resources_usage", jdbc_driver_library=>"/tmp/csjdbc.jar", jdbc_connection_string=>"jdbc:compositesw:dbapi@tdv-d.adeo.no:9401?domain=composite&dataSource=Plattform&encrypt=true", id=>"a0e659a8833566cdb07ea1c5963d3349c7a7414190c062773b4a09c42f390373", jdbc_driver_class=>"cs.jdbc.driver.CompositeDriver", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_14163149-e167-4b55-9ab9-3455d2dfd09d", enable_metric=>true, charset=>"UTF-8">, jdbc_paging_enabled=>false, jdbc_page_size=>100000, jdbc_validate_connection=>false, jdbc_validation_timeout=>3600, jdbc_pool_timeout=>5, sql_log_level=>"info", connection_retry_attempts=>1, connection_retry_attempts_wait_time=>0.5, plugin_timezone=>"utc", last_run_metadata_path=>"/root/.logstash_jdbc_last_run", use_column_value=>false, tracking_column_type=>"numeric", clean_run=>false, record_last_run=>true, lowercase_column_names=>true, use_prepared_statements=>false>
  Error: cs.jdbc.driver.CompositeDriver not loaded. Are you sure you've included the correct jdbc driver in :jdbc_driver_library?
  Exception: LogStash::PluginLoadingError
  Stack: /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/jdbc.rb:180:in `open_jdbc_connection'
/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/jdbc.rb:243:in `execute_statement'
/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb:309:in `execute_query'
/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb:281:in `run'
/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:309:in `inputworker'
/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:302:in `block in start_input'

I'm running OpenJDK 11, and the TDV admins who use the same jar and the same class also use OpenJDK 11, so it seems to be not a problem of different java versions.

I've tried placing the jar file directly under logstash-core/lib/jars and removing jdbc_driver_library from the configuration, but the result is the same.

Could somebody please advise me how to debug the issue further or point to the culprit?

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