I have a java project and am connecting to mongod process using the
following
code
private static Mongo mongoObj = null;
private static DB db = null;
mongoObj = new Mongo("localhost", 27017 );
db = mongoObj.getDB( "MyDataBase" );
I was using this code for the last 4months and have created thousands of
documents but suddenly I am unable to connect to MongoD process.
But when I change from IP address to use "localhost" it works.
java.io.IOException: couldn't connect to [/"IPADDRESS OF THE MACHINE":27017]
bc:java.net.Conne
ctException: Connection timed out: connect
at com.mongodb.DBPort._open(DBPort.java:206)
at com.mongodb.DBPort.go(DBPort.java:94)
at com.mongodb.DBPort.go(DBPort.java:75)
at com.mongodb.DBPort.findOne(DBPort.java:129)
at com.mongodb.DBPort.runCommand(DBPort.java:138)
at
com.mongodb.DBTCPConnector.fetchMaxBsonObjectSize(DBTCPConnector.java
:419)
at com.mongodb.DBTCPConnector.checkMaster(DBTCPConnector.java:406)
at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:144)
at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:137)
at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:255)
at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:210)
at com.mongodb.DBCollection.insert(DBCollection.java:80)
--
Thank you and Regards
Ajinkya Prabhune
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongodb-user@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
