<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 09:02: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-4438] Mongo java driver upgrade from 3.12.1 to 4.2.3 throws method not found errors</title>
                <link>https://jira.mongodb.org/browse/JAVA-4438</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;&lt;em&gt;Hii&lt;/em&gt;&lt;br/&gt;
&lt;em&gt;We have java application based on mongo server 4.2 and component versions are as follows&lt;/em&gt; &lt;br/&gt;
&lt;em&gt;spring-boot 2.2.5.RELEASE&lt;/em&gt;&lt;br/&gt;
&lt;em&gt;spring-data-mongodb2.2.5.RELEASE&lt;/em&gt;&lt;br/&gt;
&lt;em&gt;mongo-java-driver3.12.1&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;We had to update spring boot to 2.5.8 hence we made few changes to update dependencies as follow&lt;/em&gt; &lt;br/&gt;
&lt;em&gt;spring-boot2.5.8&lt;/em&gt;&lt;br/&gt;
&lt;em&gt;spring-starter-parent2.5.8&lt;/em&gt;&lt;br/&gt;
&lt;em&gt;spring-data-mongodb 3.2.3&lt;/em&gt;&lt;br/&gt;
&lt;em&gt;mongodb-driver-core 4.2.3&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;As we were using newly added import com.mongodb.client.MongoClient;&lt;/em&gt;&lt;br/&gt;
&lt;em&gt;import com.mongodb.client.MongoClients; we updated to &lt;b&gt;mongodb-driver-sync 4.2.3&lt;/b&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;*&lt;b&gt;We resolved all compilation error but on deployment we got errors like methos not found for *getSrvHost()&lt;/b&gt; on further debugging we found that old dependency mongo-java-driver 3.3.0 was already present in project&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;&lt;em&gt;We excluded that and above issue is resolved now no old dependency is present but still we are getting following error without using legacy API approach&lt;/em&gt; &lt;/p&gt;


&lt;p&gt;&lt;em&gt;&lt;font color=&quot;#242424&quot;&gt;java.lang.NoClassDefFoundError: com/mongodb/MongoClient&lt;/font&gt;&lt;/em&gt;&lt;br/&gt;
&lt;em&gt;&lt;font color=&quot;#242424&quot;&gt;Caused by: java.lang.NoClassDefFoundError: com/mongodb/MongoClient&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;&lt;em&gt;We are completely stuck at this point&lt;/em&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="1959447">JAVA-4438</key>
            <summary>Mongo java driver upgrade from 3.12.1 to 4.2.3 throws method not found errors</summary>
                <type id="6" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14720&amp;avatarType=issuetype">Question</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="13203">Gone away</resolution>
                                        <assignee username="jeff.yemin@mongodb.com">Jeffrey Yemin</assignee>
                                    <reporter username="sanket@yopmail.com">Sanket Chauhan</reporter>
                        <labels>
                            <label>external-user</label>
                    </labels>
                <created>Thu, 6 Jan 2022 15:03:31 +0000</created>
                <updated>Fri, 27 Oct 2023 19:48:31 +0000</updated>
                            <resolved>Tue, 8 Feb 2022 12:00:50 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="4341657" author="dbeng-pm-bot" created="Tue, 8 Feb 2022 12:00:51 +0000"  >&lt;p&gt;There hasn&apos;t been any recent activity on this ticket, so we&apos;re resolving it. Thanks for reaching out! Please feel free to comment on this if you&apos;re able to provide more information.&lt;/p&gt;</comment>
                            <comment id="4282892" author="jeff.yemin" created="Mon, 10 Jan 2022 13:30:22 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=sanket%40yopmail.com&quot; class=&quot;user-hover&quot; rel=&quot;sanket@yopmail.com&quot;&gt;sanket@yopmail.com&lt;/a&gt;&#160;no on will be able to move this issue forward without more information about your application, or at least a full stack trace. The only thing we can tell you right now is that your application has ended up with a mix of dependencies between the 3.x and 4.x drivers, and you need to figure out where the 3.x dependencies are coming from and then remove them.&#160;&#160;&lt;/p&gt;

&lt;p&gt;Without a stack trace, the next best option would be for you to post a full Java project (i.e with Maven pom.xml or equivalent) that demonstrates the problem.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="4282468" author="JIRAUSER1264255" created="Mon, 10 Jan 2022 06:05:46 +0000"  >&lt;p&gt;There is no stack trace for the same getting single line error only but with further debugging we found that there are few cron job running through our code which are asynchronous.&lt;/p&gt;

&lt;p&gt;Mongo java driver 3.12.1 was async driver and we are shifted to mongodb-driver-sync 4.2.3 shifting from async to sync can create such issues?&lt;/p&gt;

&lt;p&gt;Is there is any full fleshed document for mongo driver and spring data mongodb upgrade ?&lt;/p&gt;</comment>
                            <comment id="4279988" author="mpaluch@paluch.biz" created="Fri, 7 Jan 2022 08:14:27 +0000"  >&lt;p&gt;For the record, Spring Boot 2.5.8 is compatible with Spring Data MongoDB 3.2.x and pulls in the driver version 4.2.3.&lt;/p&gt;</comment>
                            <comment id="4278824" author="jeff.yemin" created="Thu, 6 Jan 2022 16:57:42 +0000"  >&lt;p&gt;Please paste in the full stack trace for the &lt;tt&gt;NoSuchMethodError&lt;/tt&gt;.&#160; That method was indeed removed in the 4.0 release, so you would need to figure out what is attempting to call it.&lt;/p&gt;</comment>
                            <comment id="4278548" author="JIRAUSER1264255" created="Thu, 6 Jan 2022 15:46:44 +0000"  >&lt;p&gt;On addition of mongodb-driver-legacy 4.2.3 dependency it throws different error &lt;b&gt;java.lang.NoSuchMethodError: com.mongodb.MongoClient.setWriteConcern(Lcom/mongodb/WriteConcern;)V&lt;/b&gt;&lt;br/&gt;
 &lt;b&gt;Caused by: java.lang.NoSuchMethodError: com.mongodb.MongoClient.setWriteConcern(Lcom/mongodb/WriteConcern&lt;/b&gt;&lt;br/&gt;
If it is related to spring data where can we raise the issue to get help.Thanks in advance!&lt;/p&gt;</comment>
                            <comment id="4278430" author="jeff.yemin" created="Thu, 6 Jan 2022 15:18:58 +0000"  >&lt;p&gt;Looks like one of your colleagues already reported this in &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-4437&quot; title=&quot;GettingClusterSettings.getSrvHost() method not found error on application deployment while upgrading mongo java driver from 3.11.2 to 4.2.3 &quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-4437&quot;&gt;&lt;del&gt;JAVA-4437&lt;/del&gt;&lt;/a&gt;.&#160; As I commented there, I don&apos;t think this is a driver issue.&#160; It may be something with Spring Data or some other dependency of your application.&#160; &#160;I suggest adding the dependency on the mongodb-driver-legacy module to work around the issue.&lt;/p&gt;

&lt;p&gt;If you do need further help from MongoDB:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Our MongoDB support portal, located at &lt;a href=&quot;https://support.mongodb.com/welcome&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;support.mongodb.com&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;Our MongoDB community portal, located &lt;a href=&quot;https://developer.mongodb.com/community/forums/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;If you are an Atlas customer, you can review your support options by clicking Support in the top menu bar of the Atlas UI&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&#160;&lt;/p&gt;</comment>
                    </comments>
                    <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_10257" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Documentation Changes</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="11861"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hzz9hj:</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>