<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:58:05 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-2792] Server Connection</title>
                <link>https://jira.mongodb.org/browse/JAVA-2792</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;I trying to connect server but I am getting this error&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;ins&gt;Error&lt;/ins&gt;&lt;/b&gt;&lt;br/&gt;
_com.mongodb.MongoTimeoutException: &lt;br/&gt;
		Timed out after 3000 ms while waiting to connect. Client view of cluster state is &lt;br/&gt;
		{type=UNKNOWN, &lt;br/&gt;
		servers=[{&lt;br/&gt;
			address=&amp;lt;server_address&amp;gt;:27017,&lt;br/&gt;
			type=UNKNOWN,&lt;br/&gt;
			state=CONNECTING,&lt;br/&gt;
			exception=&lt;/p&gt;
{
				com.mongodb.MongoException: java.lang.NoClassDefFoundError: com.mongodb.connection.ScramSha1Authenticator$ScramSha1SaslClient
			}
&lt;p&gt;,&lt;br/&gt;
			caused by &lt;/p&gt;
{java.lang.NoClassDefFoundError: com.mongodb.connection.ScramSha1Authenticator$ScramSha1SaslClient}
&lt;p&gt;		}]_&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;ins&gt;This is my Code:&lt;/ins&gt;&lt;/b&gt;&lt;br/&gt;
_MongoClientOptions.Builder o = MongoClientOptions.builder().serverSelectionTimeout(3000);&lt;br/&gt;
            MongoCredential credential = MongoCredential.createCredential(&quot;admin&quot;, &quot;&amp;lt;database_name&amp;gt;&quot;,&quot;admin&quot;.toCharArray());&lt;/p&gt;

&lt;p&gt;            // Creating a Mongo client&lt;br/&gt;
            MongoClient mongo = new MongoClient( new ServerAddress(&quot;&amp;lt;server_address&amp;gt;&quot; , 27017),credential,o.build());&lt;/p&gt;

&lt;p&gt;            System.out.println(&quot;Connected to the database successfully &quot;);&lt;/p&gt;

&lt;p&gt;            // Accessing the database&lt;br/&gt;
            MongoDatabase database = mongo.getDatabase(&quot;&amp;lt;database_name&amp;gt;&quot;);&lt;br/&gt;
            System.out.println(&quot;Collection created successfully&quot;);&lt;br/&gt;
            // Retrieving a collection&lt;br/&gt;
            MongoCollection&amp;lt;Document&amp;gt; collection = database.getCollection(&quot;&amp;lt;collection_name&amp;gt;&quot;);&lt;br/&gt;
            System.out.println(&quot;Collection sampleCollection selected successfully &quot;);&lt;/p&gt;

&lt;p&gt;            //Getting the iterable object&lt;br/&gt;
            FindIterable&amp;lt;Document&amp;gt; iterDoc = collection.find();&lt;br/&gt;
            int i = 1;&lt;/p&gt;


&lt;p&gt;            String s = null;&lt;br/&gt;
            // Getting the iterator&lt;br/&gt;
            Iterator it = null;&lt;br/&gt;
            try {&lt;br/&gt;
                it = iterDoc.iterator();&lt;br/&gt;
                while (it.hasNext()) &lt;/p&gt;
{
                    System.out.println(it.next());
                    s+=it.next().toString();
                    i++;
                }
&lt;p&gt;            } catch (Exception e) &lt;/p&gt;
{
                e.printStackTrace();
                Log.i(&quot;TAG&quot;,&quot;&quot;+e);
            }
&lt;p&gt;            return s;_&lt;/p&gt;
</description>
                <environment></environment>
        <key id="502295">JAVA-2792</key>
            <summary>Server Connection</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="pritam@affwl.com">pritam dhuri</reporter>
                        <labels>
                    </labels>
                <created>Mon, 26 Feb 2018 06:49:40 +0000</created>
                <updated>Wed, 11 Sep 2019 19:10:03 +0000</updated>
                            <resolved>Thu, 1 Mar 2018 09:25:27 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="1819551" author="ross@10gen.com" created="Thu, 1 Mar 2018 09:24:27 +0000"  >&lt;p&gt;Thanks &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=pritam%40affwl.com&quot; class=&quot;user-hover&quot; rel=&quot;pritam@affwl.com&quot;&gt;pritam@affwl.com&lt;/a&gt; - that makes more sense now - due to the limitations of Android JRE the classes aren&apos;t available to support Scram Sha 1 authentication. Currently, there are no plans to support this, so I&apos;m closing the ticket as Won&apos;t Fix.&lt;/p&gt;</comment>
                            <comment id="1819511" author="pritam@affwl.com" created="Thu, 1 Mar 2018 07:06:08 +0000"  >&lt;p&gt;Hi Ross Lawley..&lt;br/&gt;
Thanks for your response, but I am still facing issues while connection to my android app..  &lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;ins&gt;Error Message&lt;/ins&gt;&lt;/b&gt;&lt;br/&gt;
com.mongodb.MongoTimeoutException: Timed out after 3000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=&amp;lt;server_name&amp;gt;, type=UNKNOWN, state=CONNECTING, exception=&lt;/p&gt;
{com.mongodb.MongoException: java.lang.NoClassDefFoundError: com.mongodb.connection.ScramSha1Authenticator$ScramSha1SaslClient}
&lt;p&gt;, caused by {java.lang.NoClassDefFoundError: com.mongodb.connection.ScramSha1Authenticator$ScramSha1SaslClient}}]&lt;/p&gt;</comment>
                            <comment id="1816955" author="ross@10gen.com" created="Tue, 27 Feb 2018 11:04:51 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=pritam%40affwl.com&quot; class=&quot;user-hover&quot; rel=&quot;pritam@affwl.com&quot;&gt;pritam@affwl.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;The &lt;tt&gt;java.lang.NoClassDefFoundError: com.mongodb.connection.ScramSha1Authenticator$ScramSha1SaslClient&lt;/tt&gt; error points to an incorrectly setup Mongo Java Driver.  &lt;/p&gt;

&lt;p&gt;Please check the class path and ensure you have all the dependencies installed - crucial if downloading the jars manually and not using the uber jar.  Please see the &lt;a href=&quot;http://mongodb.github.io/mongo-java-driver/3.6/driver/getting-started/installation/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;installation guide&lt;/a&gt; for more information.&lt;/p&gt;

&lt;p&gt;Just for future reference the best place for questions regarding MongoDB usage or the Java driver specifics is the &lt;a href=&quot;https://groups.google.com/forum/#!forum/mongodb-user&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongodb-user mailinglist&lt;/a&gt; or &lt;a href=&quot;http://stackoverflow.com&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;stackoverflow&lt;/a&gt; as you will reach a boarder audience there.  If your business requires an answer from MongoDB within a time frame then we do offer &lt;a href=&quot;https://www.mongodb.com/products/production-support&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;production support&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;All the best,&lt;/p&gt;

&lt;p&gt;Ross&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="229451">JAVA-1958</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </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|htij6n:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>