# Error: java.lang.ClassNotFoundException: com.dbschema.MongoJdbcDriver. Are you sure you've included the correct jdbc driver in :jdbc\_driver\_library?

**URL:** <https://discuss.elastic.co/t/error-java-lang-classnotfoundexception-com-dbschema-mongojdbcdriver-are-you-sure-youve-included-the-correct-jdbc-driver-in-jdbc-driver-library/298460>\
**Category:** Logstash\
**Tags:** docker\
**Created:** [March 1, 2022, 3:04am UTC](https://discuss.elastic.co/t/error-java-lang-classnotfoundexception-com-dbschema-mongojdbcdriver-are-you-sure-youve-included-the-correct-jdbc-driver-in-jdbc-driver-library/298460 "2022-03-01T03:04:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amal\_Anush](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amal_anush/32/102437_2.png) [@Amal\_Anush](https://discuss.elastic.co/u/Amal_Anush)\
**Post date:** [March 1, 2022, 3:04am UTC](https://discuss.elastic.co/t/error-java-lang-classnotfoundexception-com-dbschema-mongojdbcdriver-are-you-sure-youve-included-the-correct-jdbc-driver-in-jdbc-driver-library/298460/1 "2022-03-01T03:04:03Z")

</div>

hi , im using dbschema mongo driver to connect to move data from mongo to logstash . but here is the error

* * *

## Error: java.lang.ClassNotFoundException: com.dbschema.MongoJdbcDriver. Are you sure you've included the correct jdbc driver in :jdbc\_driver\_library? elastic-search-logstash-1 | Exception: LogStash::PluginLoadingError elastic-search-logstash-1 | Stack: /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-integration-jdbc-5.2.2/lib/logstash/plugin\_mixins/jdbc/common.rb:45:in `load\_driver'

my docker compose file  
version: '3.7'

services:

logstash:

```
image: logstash:8.0.0

ports:

  - '5000:5000'

volumes:

  - type: bind

    source: ./pipelines/

    target: /usr/share/logstash/pipeline

    read_only: true

  - type: bind

    source: ./jdbc-connector/

    target: /usr/share/logstash/jdbc-connector  

    read_only: true

  - type: bind

    source: ./MongoDbJdbcDriver/mongojdbc4.0.jar

    target: /usr/share/logstash/logstash-core/lib/jars/mongojdbc4.0.jar

    read_only: true      

  - type: bind

    source: ./logstash-config/logstash.yml

    target: /usr/share/logstash/config/logstash.yml

    read_only: true

```

* * *

my pipeline

input {  
jdbc  
{  
jdbc\_driver\_library =\> "/usr/share/logstash/logstash-core/lib/jars/mongojdbc4.0.jar"  
jdbc\_driver\_class =\> "com.dbschema.MongoJdbcDriver"  
jdbc\_user =\> "---"  
jdbc\_password =\> "----"  
jdbc\_connection\_string =\> "-----"  
statement =\> "db.t\_ams\_employee\_tickets.find({ }, {'\_id': false})"  
}  
}  
filter {  
mutate {  
rename =\> { "[\_id]" =\> "documentId" }  
}  
}

---

<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:** [March 29, 2022, 3:05am UTC](https://discuss.elastic.co/t/error-java-lang-classnotfoundexception-com-dbschema-mongojdbcdriver-are-you-sure-youve-included-the-correct-jdbc-driver-in-jdbc-driver-library/298460/2 "2022-03-29T03:05:02Z")

</div>

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