I have an issue with MongoDB version 2.0.1. I have installed it on an Ubuntu machine that is 32 bit. I am able to connect to it through the command prompt, but not able to connect to it through Java code. This same code used to work with the older MongoDB version. I get the following exception.
Caused by: com.mongodb.MongoInternalException: DBPort.findOne failed
at com.mongodb.DBPort.findOne(DBPort.java:153)
at com.mongodb.DBPort.runCommand(DBPort.java:159)
at com.mongodb.DBTCPConnector.testMaster(DBTCPConnector.java:369)
at com.mongodb.Mongo.<init>(Mongo.java:140)
at
com..bean.MongoCollectionPoolBean.init(MongoCollectionPoolBean.java:
42)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
43)
at java.lang.reflect.Method.invoke(Method.java:616)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:
1544)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:
1485)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:
1417)
... 24 more
Caused by: java.io.IOException: couldn't connect to
[domU-12-31-39-0B-26-01/67.265.65.132:27017]
bc:java.net.ConnectException: Connection timed out
at com.mongodb.DBPort._open(DBPort.java:205)
at com.mongodb.DBPort.go(DBPort.java:85)
at com.mongodb.DBPort.findOne(DBPort.java:145)
... 35 more
When I try to reproduce the same problem with my local system (Mac Lion 64 bit) it works fine. When I see the server logs here is what i see on my local system:
[clientcursormon] mem (MB) res:14 virt:2434 mapped:0
and on Ubuntu (where it is not working)
[clientcursormon] mem (MB) res:14 virt:86 mapped:0