3

I recenty updated to MongoDB 2.6.3 via Ubuntu debs and also switched to Mongo Client library 2.12.2; when I now execute

    final MongoClient m = new MongoClient( "localhost" );
    DB db = m.getDB( "test" );
    System.out.println( db.getName( ) );
    System.out.println( db.collectionExists( "Customer" ) );

then the "test" sysout is written, but during the collectionExists() method a timeout occurs:

Exception in thread "main" com.mongodb.MongoTimeoutException: Timed out while waiting to connect after 4996 ms
at com.mongodb.BaseCluster.getDescription(BaseCluster.java:114)
at com.mongodb.DBTCPConnector.getClusterDescription(DBTCPConnector.java:396)
at com.mongodb.DBTCPConnector.getMaxBsonObjectSize(DBTCPConnector.java:641)
at com.mongodb.Mongo.getMaxBsonObjectSize(Mongo.java:641)
at com.mongodb.DBCollectionImpl.find(DBCollectionImpl.java:81)
at com.mongodb.DBCollectionImpl.find(DBCollectionImpl.java:66)
at com.mongodb.DB.getCollectionNames(DB.java:510)
at com.mongodb.DB.collectionExists(DB.java:553)
at com.apiomat.backend.persistence.MongoFacade.main(MongoFacade.java:342)

I can connect to MongoDB via the command line client tool and query what I want without problems.

Andreas
  • 2,211
  • 1
  • 18
  • 36

0 Answers0