# java::mongodb.jdbc.MongoDriver not loaded. Are you sure you've included the correct jdbc driver in :jdbc\_driver\_library

**URL:** https://discuss.elastic.co/t/java-mongodb-jdbc-mongodriver-not-loaded-are-you-sure-youve-included-the-correct-jdbc-driver-in-jdbc-driver-library/107025
**Category:** Logstash
**Created:** [November 9, 2017, 10:47am UTC](https://discuss.elastic.co/t/java-mongodb-jdbc-mongodriver-not-loaded-are-you-sure-youve-included-the-correct-jdbc-driver-in-jdbc-driver-library/107025 "2017-11-09T10:47:09Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![pavi](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@pavi](https://discuss.elastic.co/u/pavi)
#### Post date: [November 9, 2017, 10:47am UTC](https://discuss.elastic.co/t/java-mongodb-jdbc-mongodriver-not-loaded-are-you-sure-youve-included-the-correct-jdbc-driver-in-jdbc-driver-library/107025/1 "2017-11-09T10:47:10Z")

</div>

Hi,

I am getting error while using Mongodb Driver.

logstash conf file

input {  
jdbc {

```
jdbc_driver_library => "C://elk//logstash//bin//unityjdbc.jar"
jdbc_driver_class => "java::mongodb.jdbc.MongoDriver"
jdbc_connection_string => "jdbc:mongo://localhost:27017/myDb"
jdbc_user => ""
jdbc_password => ""
jdbc_validate_connection => true
statement => "db.past.find()"
tags => "mongodb"

```

}  
}

output {  
elasticsearch {  
hosts =\> ["localhost:9200"]  
index =\> "contacts"  
document\_type =\> "contact"  
document\_id =\> "%{uid}"

```
}
stdout { codec => rubydebug } 

```

}

Error:  
[2017-11-09T10:36:16,869][ERROR][logstash.pipeline] A plugin had an unrecoverable error. Will restart this plugin.  
Plugin: \<LogStash::Inputs::Jdbc jdbc\_driver\_library=\>"C://elk//logstash//bin//unityjdbc.jar", jdbc\_driver\_class=\>"java::mongodb.jdbc.MongoDriver", jdbc\_connection\_string=\>"jdbc:mongo://localhost:27017/myDb", jdbc\_password=\>, jdbc\_validate\_connection=\>true, statement=\>"db.past.find()", tags=\>["mongodb"], id=\>"79b7810d654c0eceb011c9c78c294342530aea69-1", enable\_metric=\>true, codec=\>\<LogStash::Codecs::Plain id=\>"plain\_d14e6f56-39e2-46a4-af99-f17e2964935e", enable\_metric=\>true, charset=\>"UTF-8"\>, jdbc\_paging\_enabled=\>false, jdbc\_page\_size=\>100000, jdbc\_validation\_timeout=\>3600, jdbc\_pool\_timeout=\>5, sql\_log\_level=\>"info", connection\_retry\_attempts=\>1, connection\_retry\_attempts\_wait\_time=\>0.5, parameters=\>{"sql\_last\_value"=\>1970-01-01 00:00:00 UTC}, last\_run\_metadata\_path=\>"C:\Windows\system32\config\systemprofile/.logstash\_jdbc\_last\_run", use\_column\_value=\>false, tracking\_column\_type=\>"numeric", clean\_run=\>false, record\_last\_run=\>true, lowercase\_column\_names=\>true\>  
Error: java::mongodb.jdbc.MongoDriver not loaded. Are you sure you've included the correct jdbc driver in :jdbc\_driver\_library?

Can anyone please help me to resolve the error ?

---

<div class="post-metadata">

### Author: ![Ramon\_Lawrence](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Ramon\_Lawrence](https://discuss.elastic.co/u/Ramon_Lawrence)
#### Post date: [November 9, 2017, 5:45pm UTC](https://discuss.elastic.co/t/java-mongodb-jdbc-mongodriver-not-loaded-are-you-sure-youve-included-the-correct-jdbc-driver-in-jdbc-driver-library/107025/2 "2017-11-09T17:45:46Z")

</div>

Make sure you use the JDBC JAR file mongodb\_unityjdbc\_full.jar. When you download the install program, the JAR file is UnityJDBC\_Trial\_Install.jar which needs to be run by using the command: java -jar UnityJDBC\_Trial\_install.jar

The mongodb\_unityjdbc\_full.jar will be in the installation directory after install is complete.

---

<div class="post-metadata">

### Author: ![pavi](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@pavi](https://discuss.elastic.co/u/pavi)
#### Post date: [November 9, 2017, 5:57pm UTC](https://discuss.elastic.co/t/java-mongodb-jdbc-mongodriver-not-loaded-are-you-sure-youve-included-the-correct-jdbc-driver-in-jdbc-driver-library/107025/3 "2017-11-09T17:57:42Z")

</div>

Thanks Lawrence. This resolved the issue

---

<div class="post-metadata">

### Author: ![rgheleri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rgheleri/32/18497_2.png) [@rgheleri](https://discuss.elastic.co/u/rgheleri)
#### Post date: [November 28, 2017, 7:10pm UTC](https://discuss.elastic.co/t/java-mongodb-jdbc-mongodriver-not-loaded-are-you-sure-youve-included-the-correct-jdbc-driver-in-jdbc-driver-library/107025/4 "2017-11-28T19:10:23Z")

</div>

This not work for me. I'm still getting error.

---

<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: [December 26, 2017, 7:10pm UTC](https://discuss.elastic.co/t/java-mongodb-jdbc-mongodriver-not-loaded-are-you-sure-youve-included-the-correct-jdbc-driver-in-jdbc-driver-library/107025/5 "2017-12-26T19:10:40Z")

</div>

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