camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Farès Hassak (JIRA) <>
Subject [jira] [Created] (CAMEL-12142) Tests failed because of incorrect mongodb host
Date Sun, 14 Jan 2018 16:29:03 GMT
Farès Hassak created CAMEL-12142:

             Summary: Tests failed because of incorrect mongodb host
                 Key: CAMEL-12142
             Project: Camel
          Issue Type: Bug
          Components: camel-mongodb, camel-mongodb3

            Reporter: Farès Hassak


The tests have failed in component camel-mongodb, camel-mongodb3, camel-mongodb-gridfs:
com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting to connect. Client
view of cluster state is {type=UNKNOWN, servers=[{address=, type=UNKNOWN, state=CONNECTING,
exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {
connect timed out}}]
	at com.mongodb.connection.BaseCluster.getDescription(
	at com.mongodb.Mongo.getConnectedClusterDescription(
	at com.mongodb.Mongo.createClientSession(
	at com.mongodb.Mongo$3.getClientSession(
	at com.mongodb.Mongo$3.execute(
	at com.mongodb.MongoCollectionImpl.executeDrop(
	at com.mongodb.MongoCollectionImpl.drop(
	at org.apache.camel.component.mongodb.AbstractMongoDbTest.doPostSetup(
	at org.apache.camel.test.junit4.CamelTestSupport.setUp(

Because the client is using the wrong address when connecting to mongodb:


The MongoClient is created here :


 public class EmbedMongoConfiguration {

 public MongoClient myDb() throws UnknownHostException {
        return new MongoClient("", PORT);

I suggest to use the default mongodb host : 


As défined in ServerAdress class in mongodb java driver :


public class ServerAddress implements Serializable {
     * Returns the default database host: ""
     * @return IP address of default host.
    public static String defaultHost() {
        return ""; // NOPMD

The EmbedMongoConfiguration class should return a Mongclient object with default mongodb host

 public class EmbedMongoConfiguration {

 public MongoClient myDb() throws UnknownHostException {
        return new MongoClient(defaultHost(), PORT);

Here my configuration :

Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T09:58:13+02:00)
Maven home: D:\apache-maven-3.5.2\bin\..
Java version: 1.8.0_152, vendor: Oracle Corporation
Java home: D:\jdk1.8.0_152\jre
Default locale: fr_FR, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"


This message was sent by Atlassian JIRA

View raw message