<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:53:43 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[JAVA-1060] Mongodb doesn&apos;t work for IPv6 address.</title>
                <link>https://jira.mongodb.org/browse/JAVA-1060</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;In mongodb/mongo-java-driver, class com.mongodb.Mongo.java don&apos;t support IPv6.&lt;br/&gt;
The issue is when I use string host with ipv6 address and mongo options with  method:&lt;br/&gt;
@Deprecated&lt;br/&gt;
    public Mongo( String host , MongoOptions options )&lt;br/&gt;
        throws UnknownHostException {&lt;br/&gt;
        this( new ServerAddress( host ) , options );&lt;br/&gt;
}&lt;br/&gt;
-&amp;gt; It cannot parse IPv6 address.&lt;br/&gt;
I try to customize class Mongo as:&lt;/p&gt;

&lt;p&gt;  public Mongo( String host , MongoOptions options )&lt;br/&gt;
        throws UnknownHostException {&lt;br/&gt;
        this( new ServerAddress(InetAddress.getByName(host)) , options );&lt;br/&gt;
}&lt;br/&gt;
-&amp;gt; I can work with IPv6 address directly.&lt;/p&gt;

&lt;p&gt;Please give to your comment and how to fix it in this case.&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;

</description>
                <environment></environment>
        <key id="103355">JAVA-1060</key>
            <summary>Mongodb doesn&apos;t work for IPv6 address.</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="craig.wilson@mongodb.com">Craig Wilson</assignee>
                                    <reporter username="edamtrong11788">Dinh Dinh Trong</reporter>
                        <labels>
                    </labels>
                <created>Fri, 20 Dec 2013 03:42:24 +0000</created>
                <updated>Thu, 3 Apr 2014 15:22:35 +0000</updated>
                            <resolved>Sun, 22 Dec 2013 14:44:02 +0000</resolved>
                                    <version>2.11.2</version>
                                    <fixVersion>2.12.0</fixVersion>
                    <fixVersion>3.0.0</fixVersion>
                                    <component>API</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                                                            <comments>
                            <comment id="474218" author="edamtrong11788" created="Mon, 23 Dec 2013 03:59:35 +0000"  >&lt;p&gt;Ok, Thanks Jeff,&lt;br/&gt;
I used mongo connection with Ipv6 address. &lt;/p&gt;</comment>
                            <comment id="474213" author="jeff.yemin" created="Mon, 23 Dec 2013 03:42:11 +0000"  >&lt;p&gt;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.&lt;/p&gt;</comment>
                            <comment id="474204" author="edamtrong11788" created="Mon, 23 Dec 2013 02:50:25 +0000"  >&lt;p&gt;Thanks Jeff,&lt;br/&gt;
I will check it,&lt;br/&gt;
Can I use mongo-java-driver snapshoot with  maven ?&lt;br/&gt;
How about version of mongo-java-driver is ? &lt;/p&gt;</comment>
                            <comment id="474137" author="jeff.yemin" created="Sun, 22 Dec 2013 14:44:03 +0000"  >&lt;p&gt;Fixed in master and 3.0.x&lt;/p&gt;</comment>
                            <comment id="473709" author="jeff.yemin" created="Fri, 20 Dec 2013 15:12:14 +0000"  >&lt;p&gt;Apologies, you&apos;re absolutely right.  I don&apos;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.&lt;/p&gt;</comment>
                            <comment id="473581" author="edamtrong11788" created="Fri, 20 Dec 2013 04:44:39 +0000"  >&lt;p&gt;Thanks Jeff,&lt;br/&gt;
My problem that I am using config by applicationContext.xml in Spring data Mongo. It will call class com.mongodb.Mongo.java in case:&lt;br/&gt;
&amp;lt;mongo:mongo id=&quot;mongo&quot; host=&quot;2001::125&quot; &amp;gt;&lt;br/&gt;
&amp;lt;mongo:options connections-per-host=&quot;25&quot;&lt;br/&gt;
	....&lt;br/&gt;
 /&amp;gt;&lt;br/&gt;
&amp;lt;/mongo:mongo&amp;gt;&lt;br/&gt;
Do you know resolve this problem ?&lt;/p&gt;

&lt;p&gt;Beside that, if I use MongoClient(new ServerAddress(&quot;2001::125&quot;, 27017), ...) then it will call&lt;br/&gt;
 public ServerAddress( String host , int port ) throws UnknownHostException {&lt;br/&gt;
        if ( host == null )&lt;br/&gt;
            host = defaultHost();&lt;br/&gt;
        host = host.trim();&lt;br/&gt;
        if ( host.length() == 0 )&lt;br/&gt;
            host = defaultHost();&lt;/p&gt;

&lt;p&gt;        int idx = host.indexOf( &quot;:&quot; );&lt;br/&gt;
        if ( idx &amp;gt; 0 )&lt;/p&gt;
{
            if ( port != defaultPort() )
                throw new IllegalArgumentException( &quot;can&apos;t specify port in construct and via host&quot; );
            port = Integer.parseInt( host.substring( idx + 1 ) );
            host = host.substring( 0 , idx ).trim();
        }

&lt;p&gt;        _host = host;&lt;br/&gt;
        _port = port;&lt;br/&gt;
    }&lt;br/&gt;
It wil parse string host as:&lt;br/&gt;
-&amp;gt; host=2001&lt;br/&gt;
-&amp;gt; port=:15&lt;/p&gt;
</comment>
                            <comment id="473574" author="jeff.yemin" created="Fri, 20 Dec 2013 04:22:53 +0000"  >&lt;p&gt;OK, I see the problem.  It&apos;s because ServerAddress called with a single argument checks to see if the port is included, as in &quot;hostname:27018&quot;, Can you try this as a workaround:&lt;/p&gt;

&lt;p&gt;   new MongoClient(new ServerAddress(&quot;2001::125&quot;, 27017), ...)&lt;/p&gt;
</comment>
                            <comment id="473571" author="edamtrong11788" created="Fri, 20 Dec 2013 04:17:40 +0000"  >&lt;p&gt;When I run with IPv6 address 2001::125&lt;/p&gt;

&lt;p&gt;Caused by: java.lang.NumberFormatException: For input string: &quot;:125&quot;&lt;br/&gt;
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)&lt;br/&gt;
	at java.lang.Integer.parseInt(Integer.java:492)&lt;br/&gt;
	at java.lang.Integer.parseInt(Integer.java:527)&lt;br/&gt;
	at com.mongodb.ServerAddress.&amp;lt;init&amp;gt;(ServerAddress.java:67)&lt;br/&gt;
	at com.mongodb.ServerAddress.&amp;lt;init&amp;gt;(ServerAddress.java:46)&lt;/p&gt;</comment>
                            <comment id="473568" author="jeff.yemin" created="Fri, 20 Dec 2013 04:12:18 +0000"  >&lt;p&gt;Can you include the exception that is being thrown?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="16211">JAVA-331</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="107465">JAVA-1093</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                            <subtask id="103408">JAVA-1061</subtask>
                            <subtask id="103409">JAVA-1062</subtask>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrri3z:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>74321</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="77">Sprint 1</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>