<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 09:03:01 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-4810] In Java sync driver 4.7.1, collection.drop() does not work. Got NoClassDefFoundError for com/mongodb/client/model/DropCollectionOptions </title>
                <link>https://jira.mongodb.org/browse/JAVA-4810</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;h4&gt;&lt;a name=&quot;Summary&quot;&gt;&lt;/a&gt;Summary&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;collection.drop does not work. Got NoClassDefFoundError for com/mongodb/client/model/DropCollectionOptions&lt;/em&gt;&#160;&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Pleaseprovidetheversionofthedriver.Ifapplicable%2CpleaseprovidetheMongoDBserverversionandtopology%28standalone%2Creplicaset%2Corshardedcluster%29.&quot;&gt;&lt;/a&gt;Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).&lt;/h4&gt;
&lt;h4&gt;&lt;a name=&quot;HowtoReproduce&quot;&gt;&lt;/a&gt;How to Reproduce&lt;/h4&gt;

&lt;p&gt;MongoCollection&amp;lt;Document&amp;gt; collection = db.getCollection(&quot;test&quot;);&lt;br/&gt;
collection.drop();&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;AdditionalBackground&quot;&gt;&lt;/a&gt;Additional Background&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Please provide any additional background information that may be helpful in diagnosing the bug.&lt;/em&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="2183627">JAVA-4810</key>
            <summary>In Java sync driver 4.7.1, collection.drop() does not work. Got NoClassDefFoundError for com/mongodb/client/model/DropCollectionOptions </summary>
                <type id="6" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14720&amp;avatarType=issuetype">Question</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="jeff.yemin@mongodb.com">Jeffrey Yemin</assignee>
                                    <reporter username="rafiulahad@gmail.com">Rafiul Ahad</reporter>
                        <labels>
                    </labels>
                <created>Sun, 13 Nov 2022 22:31:33 +0000</created>
                <updated>Mon, 14 Nov 2022 01:45:31 +0000</updated>
                            <resolved>Mon, 14 Nov 2022 01:45:31 +0000</resolved>
                                    <version>4.7.1</version>
                                                    <component>Build</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="4977416" author="JIRAUSER1271807" created="Mon, 14 Nov 2022 01:36:37 +0000"  >&lt;p&gt;I forgot to mention that my app is a Spring Boot app. After I did mvn clean install, it seemed to have resolved the issue.&lt;/p&gt;

&lt;p&gt;Thank you.&lt;/p&gt;

&lt;p&gt;-Rafiul&lt;/p&gt;</comment>
                            <comment id="4977400" author="jeff.yemin" created="Mon, 14 Nov 2022 00:55:32 +0000"  >&lt;p&gt;I attached &lt;a href=&quot;#my-app.tar&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;my-app.tar&lt;/a&gt; that demonstrates what I mean by a minimal reproducible example in the context of your issue. Download it, extract the contents, and run the following command: &lt;tt&gt;mvn compile exec:java -Dexec.mainClass=&quot;com.mongodb.test.App&quot;&lt;/tt&gt; and it should print:&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;1&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;0&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;This example demonstrates that with a simple pom.xml that depends on mongodb-driver-sync:4.7.1, your code sample works as expected.&lt;/p&gt;

&lt;p&gt;Please provide a similar example that demonstrates the exception you are experiencing. Otherwise, I&apos;m going to close this issue as unreproducible.&lt;/p&gt;

&lt;p&gt;Regards,&lt;br/&gt;
Jeff&lt;/p&gt;</comment>
                            <comment id="4977376" author="JIRAUSER1271807" created="Mon, 14 Nov 2022 00:28:07 +0000"  >&lt;p&gt;public void dropCollection(MongoDatabase db, String collName)&lt;/p&gt;
{
MongoCollection&amp;lt;Document&amp;gt; collection = db.getCollection(collName);
collection.drop();
}</comment>
                            <comment id="4977373" author="jeff.yemin" created="Mon, 14 Nov 2022 00:24:03 +0000"  >&lt;p&gt;The &lt;a href=&quot;https://repo1.maven.org/maven2/org/mongodb/mongodb-driver-sync/4.7.1/mongodb-driver-sync-4.7.1.pom&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongodb-driver-sync pom&lt;/a&gt; shows pretty clearly the dependencies are correct, so I can&apos;t explain what you&apos;re seeing without more information.  &lt;/p&gt;

&lt;p&gt;Please post a &lt;a href=&quot;https://stackoverflow.com/help/minimal-reproducible-example&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;minimal reproducible example&lt;/a&gt; so we can investigate further.&lt;/p&gt;</comment>
                            <comment id="4977369" author="JIRAUSER1271807" created="Mon, 14 Nov 2022 00:19:15 +0000"  >&lt;p&gt;&#160;+- org.mongodb:mongodb-driver-sync:jar:4.7.1:compile&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;{*}INFO{*}&amp;#93;&lt;/span&gt; |&#160; +- org.mongodb:bson:jar:4.6.1:compile&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;{*}INFO{*}&amp;#93;&lt;/span&gt; |&#160; &amp;#45; org.mongodb:mongodb-driver-core:jar:4.6.1:compile&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;{*}INFO{*}&amp;#93;&lt;/span&gt; | &#160; &#160; &amp;#45; org.mongodb:bson-record-codec:jar:4.6.1:runtime&lt;/p&gt;</comment>
                            <comment id="4977359" author="jeff.yemin" created="Mon, 14 Nov 2022 00:08:54 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=rafiulahad%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;rafiulahad@gmail.com&quot;&gt;rafiulahad@gmail.com&lt;/a&gt; it&apos;s unlikely that this is a bug given how many applications are running on 4.7.  &lt;/p&gt;

&lt;p&gt;Can you run the command &lt;tt&gt;mvn dependency:tree&lt;/tt&gt; and post the output in a comment?  My hypothesis is that it will uncover a dependency conflict. &lt;/p&gt;</comment>
                            <comment id="4977353" author="JIRAUSER1271807" created="Sun, 13 Nov 2022 23:54:44 +0000"  >&lt;p&gt;Maven shows that 4.7.1 has 4.6.1 version of core and bson.&#160;&lt;/p&gt;</comment>
                            <comment id="4977352" author="jeff.yemin" created="Sun, 13 Nov 2022 23:51:13 +0000"  >&lt;p&gt;It should be, so something else must be going on.  Check if some other dependency is pinning mongodb-driver-core to an older version (DropCollectionOptions was only introduced in mongodb-driver-core:4.7.0).&lt;/p&gt;</comment>
                            <comment id="4977339" author="JIRAUSER1271807" created="Sun, 13 Nov 2022 23:35:53 +0000"  >&lt;p&gt;I currently have the following dependency in my pom.xml. Is that not enough?&lt;/p&gt;

&lt;p&gt;&amp;lt;dependency&amp;gt;&lt;br/&gt;
&amp;lt;groupId&amp;gt;org.mongodb&amp;lt;/groupId&amp;gt;&lt;br/&gt;
&amp;lt;artifactId&amp;gt;mongodb-driver-sync&amp;lt;/artifactId&amp;gt;&lt;br/&gt;
&amp;lt;version&amp;gt;4.7.1&amp;lt;/version&amp;gt;&lt;br/&gt;
&amp;lt;/dependency&amp;gt;&lt;/p&gt;</comment>
                            <comment id="4977321" author="jeff.yemin" created="Sun, 13 Nov 2022 22:57:03 +0000"  >&lt;p&gt;Please double-check that &lt;tt&gt;org.mongodb:mongodb-driver-core:4.7.1&lt;/tt&gt; and &lt;tt&gt;org.mongodb:bson:4.7.1&lt;/tt&gt; are also in your classpath.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="414833" name="my-app.tar" size="9728" author="jeff.yemin@mongodb.com" created="Mon, 14 Nov 2022 00:49:59 +0000"/>
                    </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|i10vg8:</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>