# Jdbc input plugin cannot load the driver class

**URL:** <https://discuss.elastic.co/t/jdbc-input-plugin-cannot-load-the-driver-class/212482>\
**Category:** Logstash\
**Created:** [December 19, 2019, 12:16pm UTC](https://discuss.elastic.co/t/jdbc-input-plugin-cannot-load-the-driver-class/212482 "2019-12-19T12:16:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmytrok](https://avatars.discourse-cdn.com/v4/letter/d/a5b964/32.png) [@dmytrok](https://discuss.elastic.co/u/dmytrok)\
**Post date:** [December 19, 2019, 12:16pm UTC](https://discuss.elastic.co/t/jdbc-input-plugin-cannot-load-the-driver-class/212482/1 "2019-12-19T12:16:49Z")

</div>

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](https://github.com/logstash-plugins/logstash-filter-jdbc_static/issues/47), 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?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 16, 2020, 12:16pm UTC](https://discuss.elastic.co/t/jdbc-input-plugin-cannot-load-the-driver-class/212482/2 "2020-01-16T12:16:54Z")

</div>

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