[JAVA-1060] Mongodb doesn't work for IPv6 address. Created: 20/Dec/13 Updated: 03/Apr/14 Resolved: 22/Dec/13 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | API |
| Affects Version/s: | 2.11.2 |
| Fix Version/s: | 2.12.0, 3.0.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Dinh Dinh Trong | Assignee: | Craig Wilson |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Σ Remaining Estimate: | Not Specified | Remaining Estimate: | Not Specified |
| Σ Time Spent: | Not Specified | Time Spent: | Not Specified |
| Σ Original Estimate: | Not Specified | Original Estimate: | Not Specified |
| Issue Links: |
|
||||||||||||||||
| Sub-Tasks: |
|
||||||||||||||||
| Description |
|
In mongodb/mongo-java-driver, class com.mongodb.Mongo.java don't support IPv6. public Mongo( String host , MongoOptions options ) Please give to your comment and how to fix it in this case. Thanks |
| Comments |
| Comment by Dinh Dinh Trong [ 23/Dec/13 ] |
|
Ok, Thanks Jeff, |
| Comment by Jeffrey Yemin [ 23/Dec/13 ] |
|
2.12.0-SNAPSHOT should have been published with this fix as part of our CI process on Jenkins. Let us know how it goes. |
| Comment by Dinh Dinh Trong [ 23/Dec/13 ] |
|
Thanks Jeff, |
| Comment by Jeffrey Yemin [ 22/Dec/13 ] |
|
Fixed in master and 3.0.x |
| Comment by Jeffrey Yemin [ 20/Dec/13 ] |
|
Apologies, you're absolutely right. I don't have a workaround for you for IP literals, so we will have to fix the driver. Other drivers parse the string according to RFC 2732, so the Java driver will probably follow suit. |
| Comment by Dinh Dinh Trong [ 20/Dec/13 ] |
|
Thanks Jeff, Beside that, if I use MongoClient(new ServerAddress("2001::125", 27017), ...) then it will call int idx = host.indexOf( ":" ); _host = host; |
| Comment by Jeffrey Yemin [ 20/Dec/13 ] |
|
OK, I see the problem. It's because ServerAddress called with a single argument checks to see if the port is included, as in "hostname:27018", Can you try this as a workaround: new MongoClient(new ServerAddress("2001::125", 27017), ...) |
| Comment by Dinh Dinh Trong [ 20/Dec/13 ] |
|
When I run with IPv6 address 2001::125 Caused by: java.lang.NumberFormatException: For input string: ":125" |
| Comment by Jeffrey Yemin [ 20/Dec/13 ] |
|
Can you include the exception that is being thrown? |