-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 3.2.2
-
Component/s: Connection Management
-
Environment:Mac OS X 10.11.5, Java 7
Hello,
When running the below code snippet, a MongoException is thrown.
final String host = "[2604:fe00:3:1103:250:56ff:fe98:c831]";
ServerAddress address = new ServerAddress(host, 27017);
System.out.println(address.getHost());MongoClient client = new MongoClient(host);
This is a valid IPV6 address.
Any help would be appreciated. I have tried many different ways of instantiating the client, they all fall back to the same process.
- Make ServerAddress using host string.
- Pass to MongoClient.
- Attempt MongoClient Construction using address.
- Exception thrown.
The exception is:
com.mongodb.MongoException: host and port should be specified in host:port format at com.mongodb.ServerAddress.<init>(ServerAddress.java:122) at com.mongodb.connection.ClusterSettings$Builder.hosts(ClusterSettings.java:102) at com.mongodb.Mongo.createCluster(Mongo.java:670) at com.mongodb.Mongo.<init>(Mongo.java:281) at com.mongodb.Mongo.<init>(Mongo.java:277) at com.mongodb.MongoClient.<init>(MongoClient.java:174) at com.mongodb.MongoClient.<init>(MongoClient.java:151) at com.mongodb.MongoClient.<init>(MongoClient.java:121)
- related to
-
JAVA-2220 Calls to new ServerAddress(InetAddress) fail with numeric IPv6 addresses
- Closed