Skip to content

Gorm Mongodb Connection timeout resolution

October 1, 2013

We faced connection timeout when using mongodb driver:

http://jira.grails.org/browse/GPMONGODB-307

At this time Mongodb has released their new mongodb java driver version  that is a fix for issue

https://jira.mongodb.org/browse/JAVA-853

To use this latest driver do the following, Set excludes in the plugin dependencies.And add this jar to dependency list:

dependency{
compile "org.mongodb:mongo-java-driver:2.11.3"
}
plugins{
compile (":mongodb:1.3.0"){
excludes "mongo-java-driver";
}

As of date today – 1st oct, 3.0.0 is not release so you will get below error if u add it :
Loading Grails 2.3
| Configuring classpath
| Error Resolve error obtaining dependencies: Could not find artifact org.mongodb:mongo-java-driver:jar:3.0.0 in grailsCentral (http://repo.grails.org/grails/plugins)

This should resolve below error:
Connection wait timeout after 120000 ms. Stacktrace follows:
com.mongodb.DBPortPool$ConnectionWaitTimeOut: Connection wait timeout after 120000 ms
at com.mongodb.DBPortPool.get(DBPortPool.java:222)
at com.mongodb.DBTCPConnector$MyPort.get(DBTCPConnector.java:404)
at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:238)
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:216)
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:288)
at com.mongodb.DB.command(DB.java:261)
at com.mongodb.DB.command(DB.java:243)
at com.mongodb.DBCollection.getCount(DBCollection.java:985)

Advertisements
2 Comments leave one →
  1. Anonymous permalink
    October 10, 2013 5:51 pm

    I had the same issue and I’ve upgraded the java driver to 2.11.3.. still facing the same issue. 😦

  2. Anonymous permalink
    December 30, 2013 4:09 pm

    me too

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: