<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 09:03:22 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-4956] MongoClientFactory creates MongoClientImpl, not MongoClient (using JNDI)</title>
                <link>https://jira.mongodb.org/browse/JAVA-4956</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;I&apos;m attempting to create com.mongodb.client.MongoClient instances using JNDI. The com.mongodb.client.MongoClientFactory is creating com.mongodb.client.internal.MongoClientImpl instances instead.&lt;/p&gt;

&lt;p&gt;This used to work with the legacy driver (using com.mongodb.MongoClient and com.mongodb.client.jndi.MongoClientFactory).&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;p&gt;MongoDB Java driver 4.9.1 (also tried 4.3.4 and 4.6.1)&lt;/p&gt;

&lt;p&gt;MongoDB 4.4 (Atlas hosted by mongodb.com), replica set&lt;/p&gt;

&lt;p&gt;Tomcat 9.0.73&lt;/p&gt;

&lt;p&gt;Jersey 1.19.3&lt;/p&gt;

&lt;p&gt;Java 8&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;HowtoReproduce&quot;&gt;&lt;/a&gt;How to Reproduce&lt;/h4&gt;

&lt;p&gt;My server.xml contains the following:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&amp;lt;GlobalNamingResources&amp;gt;&lt;br/&gt;
&amp;lt;Resource name=&quot;mongodb/GlobalMongoClient&quot;&lt;br/&gt;
auth=&quot;Container&quot;&lt;br/&gt;
type=&quot;com.mongodb.client.MongoClient&quot;&lt;br/&gt;
closeMethod=&quot;close&quot;&lt;br/&gt;
factory=&quot;com.mongodb.client.MongoClientFactory&quot;&lt;br/&gt;
singleton=&quot;true&quot;&lt;br/&gt;
connectionString=&quot;{{ mongo_db | escape }}&quot;&lt;br/&gt;
maxTotal=&quot;100&quot;&lt;br/&gt;
maxIdle=&quot;10&quot;&lt;br/&gt;
minIdle=&quot;2&quot;&lt;br/&gt;
/&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;/GlobalNamingResources&amp;gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;My context.xml contains the following:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&amp;lt;ResourceLink name=&quot;mongodb/MyMongoClient&quot;&lt;br/&gt;
global=&quot;mongodb/GlobalMongoClient&quot;&lt;br/&gt;
type=&quot;com.mongodb.client.MongoClient&quot;/&amp;gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I copy the following files to the Tomcat global lib directory before loading the application:&lt;/p&gt;
&lt;blockquote&gt;&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;mongodb-driver-sync-4.9.1.jar&lt;/li&gt;
	&lt;li&gt;mongodb-driver-core-4.9.1.jar&lt;/li&gt;
	&lt;li&gt;slf4j-api-1.7.25.jar&lt;/li&gt;
	&lt;li&gt;slf4j-log4j12-1.7.25.jar&lt;/li&gt;
	&lt;li&gt;log4j-1.2.17.jar&lt;/li&gt;
	&lt;li&gt;bson-4.9.1.jar&lt;/li&gt;
	&lt;li&gt;bson-record-codec-4.9.1.jar&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;In my Java application, I use the following code to obtain a MongoClient:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;final MongoClient mongoClient =&lt;br/&gt;
InitialContext.doLookup(&quot;java:comp/env/mongodb/MyMongoClient&quot;);&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;When I load the application in Tomcat, everything seems fine, but when I send an http request to the server, I get the following error in the Tomcat logs:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;02-May-2023 22:27:15.746 WARNING &lt;span class=&quot;error&quot;&gt;&amp;#91;http-nio-127.0.0.1-8080-exec-2&amp;#93;&lt;/span&gt; org.apache.naming.NamingContext.lookup Unexpected exception resolving reference &#160; &#160; &#160; &#160;java.lang.IllegalArgumentException: The local resource link &lt;span class=&quot;error&quot;&gt;&amp;#91;MyMongoClient&amp;#93;&lt;/span&gt; that refers to global resource &lt;span class=&quot;error&quot;&gt;&amp;#91;mongodb/GlobalMongoClient&amp;#93;&lt;/span&gt; was expected to return an instance of &lt;span class=&quot;error&quot;&gt;&amp;#91;com.mongodb.client.MongoClient&amp;#93;&lt;/span&gt; but returned an instance of &lt;span class=&quot;error&quot;&gt;&amp;#91;com.mongodb.client.internal.MongoClientImpl&amp;#93;&lt;/span&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at org.apache.naming.factory.ResourceLinkFactory.getObjectInstance(ResourceLinkFactory.java:158) &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:332)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at org.apache.naming.NamingContext.lookup(NamingContext.java:864) &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;at org.apache.naming.NamingContext.lookup(NamingContext.java:158)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at org.apache.naming.NamingContext.lookup(NamingContext.java:850) &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;at org.apache.naming.NamingContext.lookup(NamingContext.java:158)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at org.apache.naming.NamingContext.lookup(NamingContext.java:850) &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;at org.apache.naming.NamingContext.lookup(NamingContext.java:158) &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;at org.apache.naming.NamingContext.lookup(NamingContext.java:850)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at org.apache.naming.NamingContext.lookup(NamingContext.java:172) &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;at org.apache.naming.SelectorContext.lookup(SelectorContext.java:161)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at javax.naming.InitialContext.lookup(InitialContext.java:417)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at javax.naming.InitialContext.doLookup(InitialContext.java:290)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at com.legendpower.DBInput.&amp;lt;init&amp;gt;(DBInput.java:35)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at java.lang.reflect.Constructor.newInstance(Constructor.java:423)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at com.sun.jersey.server.spi.component.ResourceComponentConstructor._construct(ResourceComponentConstructor.java:245)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at com.sun.jersey.server.spi.component.ResourceComponentConstructor.construct(ResourceComponentConstructor.java:233)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at com.sun.jersey.server.impl.resource.PerRequestFactory$PerRequest._getInstance(PerRequestFactory.java:182)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at com.sun.jersey.server.impl.resource.PerRequestFactory$AbstractPerRequest.getInstance(PerRequestFactory.java:144)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at com.sun.jersey.server.impl.application.WebApplicationContext.getResource(WebApplicationContext.java:239)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:83)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at javax.servlet.http.HttpServlet.service(HttpServlet.java:779)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at com.legendpower.GuiloadFilter.doFilter(GuiloadFilter.java:36)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:891)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1784)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; at java.lang.Thread.run(Thread.java:750)&lt;/p&gt;&lt;/blockquote&gt;
&lt;h4&gt;&lt;a name=&quot;AdditionalBackground&quot;&gt;&lt;/a&gt;Additional Background&lt;/h4&gt;

&lt;p&gt;Using this code to load the MongoClient via JNDI worked with mongo-java-driver version 3.12.8 and MongoDB 4.2, using the `com.mongodb.client.jndi.MongoClientFactory` resource factory to create the `com.mongodb.client.MongoClient` resource.&lt;/p&gt;

&lt;p&gt;I have guessed at some of the configuration above, because the JNDI documentation appears to be out of date as of driver version 4.3 (the oldest version still online). I filed a separate bug about that here:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-16093&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/DOCS-16093&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I tried a number of variations but couldn&apos;t get it to work. If I&apos;m using it incorrectly, I would be happy to be corrected.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2330572">JAVA-4956</key>
            <summary>MongoClientFactory creates MongoClientImpl, not MongoClient (using JNDI)</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="9">Done</resolution>
                                        <assignee username="jeff.yemin@mongodb.com">Jeffrey Yemin</assignee>
                                    <reporter username="jmclaren@legendpower.com">Jason McLaren</reporter>
                        <labels>
                    </labels>
                <created>Tue, 2 May 2023 23:24:50 +0000</created>
                <updated>Thu, 6 Jul 2023 14:37:06 +0000</updated>
                            <resolved>Thu, 6 Jul 2023 14:37:06 +0000</resolved>
                                                                    <component>Configuration</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="5547497" author="JIRAUSER1268808" created="Thu, 6 Jul 2023 14:36:28 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jmclaren%40legendpower.com&quot; class=&quot;user-hover&quot; rel=&quot;jmclaren@legendpower.com&quot;&gt;jmclaren@legendpower.com&lt;/a&gt; Let&apos;s close it out for now, and when this comes back up feel free to file another ticket later in the year. If you make note of this ticket number, you can reference this ticket when it comes time to refile.&lt;/p&gt;</comment>
                            <comment id="5535435" author="jmclaren@legendpower.com" created="Thu, 29 Jun 2023 22:38:49 +0000"  >&lt;p&gt;I still need to solve this problem, but it may get pushed out to later this year, as I have some more urgent priorities at work.&lt;/p&gt;

&lt;p&gt;Would it be better to close this ticket and re-open a new one later when I have a test case, or to leave it open?&lt;/p&gt;</comment>
                            <comment id="5524801" author="JIRAUSER1268808" created="Mon, 26 Jun 2023 14:36:12 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jmclaren%40legendpower.com&quot; class=&quot;user-hover&quot; rel=&quot;jmclaren@legendpower.com&quot;&gt;jmclaren@legendpower.com&lt;/a&gt; Hey Jason, have you had a chance to look into this at all? Please advise whether this is something that you still plan on looking at right now to get a reproducible example, or if we can close this out?&lt;/p&gt;</comment>
                            <comment id="5465707" author="jmclaren@legendpower.com" created="Wed, 31 May 2023 22:14:54 +0000"  >&lt;p&gt;Just responding to the bot to keep this alive. I will look into why there might be two different class loaders. I&apos;ll also see if I can remove enough code to produce a minimal reproducible example.&#160;&lt;/p&gt;</comment>
                            <comment id="5460094" author="dbeng-pm-bot" created="Tue, 30 May 2023 13:10:59 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jmclaren%40legendpower.com&quot; class=&quot;user-hover&quot; rel=&quot;jmclaren@legendpower.com&quot;&gt;jmclaren@legendpower.com&lt;/a&gt;! &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-4956&quot; title=&quot;MongoClientFactory creates MongoClientImpl, not MongoClient (using JNDI)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-4956&quot;&gt;&lt;del&gt;JAVA-4956&lt;/del&gt;&lt;/a&gt; is awaiting your response. &lt;/p&gt;

&lt;p&gt;If this is still an issue for you, please open Jira to review the latest status and provide your feedback. Thanks!&lt;/p&gt;</comment>
                            <comment id="5443587" author="jeff.yemin" created="Mon, 22 May 2023 21:03:20 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jmclaren%40legendpower.com&quot; class=&quot;user-hover&quot; rel=&quot;jmclaren@legendpower.com&quot;&gt;jmclaren@legendpower.com&lt;/a&gt; I&apos;m moving this back to Waiting for Reporter, as I don&apos;t see a path forward for resolving this without a full reproduction scenario.&lt;/p&gt;</comment>
                            <comment id="5414954" author="jeff.yemin" created="Wed, 10 May 2023 15:55:52 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jmclaren%40legendpower.com&quot; class=&quot;user-hover&quot; rel=&quot;jmclaren@legendpower.com&quot;&gt;jmclaren@legendpower.com&lt;/a&gt; sorry for the SPAM.  I&apos;m not sure what we can do about this, as it looks from the source code of &lt;tt&gt;ResourceLinkFactory&lt;/tt&gt; that this should work as designed.&lt;/p&gt;

&lt;p&gt;I suspect that the issue is that &lt;tt&gt;ResourceLinkFactory&lt;/tt&gt; uses a different &lt;tt&gt;ClassLoader&lt;/tt&gt; than &lt;tt&gt;MongoClientFactory&lt;/tt&gt;, and that&apos;s why the check &lt;tt&gt;!expectedClazz.isAssignableFrom(result.getClass())&lt;/tt&gt; is returning &lt;tt&gt;false&lt;/tt&gt; (since a class loaded by one class loader is not necessarily assignable from a class loaded by a different class loader).&lt;/p&gt;

&lt;p&gt;I&apos;m not, however, sure how you would test this hypothesis in the context of your application.&lt;/p&gt;</comment>
                            <comment id="5414856" author="jmclaren@legendpower.com" created="Wed, 10 May 2023 15:38:23 +0000"  >&lt;p&gt;What additional details are needed?&lt;/p&gt;</comment>
                            <comment id="5414042" author="dbeng-pm-bot" created="Wed, 10 May 2023 12:00:59 +0000"  >&lt;p&gt;Hey &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jmclaren%40legendpower.com&quot; class=&quot;user-hover&quot; rel=&quot;jmclaren@legendpower.com&quot;&gt;jmclaren@legendpower.com&lt;/a&gt;, We need additional details to investigate the problem. If this is still an issue for you, please provide the requested information.&lt;/p&gt;</comment>
                            <comment id="5396118" author="jeff.yemin" created="Tue, 2 May 2023 23:54:42 +0000"  >&lt;p&gt;I&apos;m not all that familiar with Tomcat but one thing I can clarify is that &lt;tt&gt;com.mongodb.client.internal.MongoClientImpl&lt;/tt&gt; is an internal class that &lt;em&gt;implements&lt;/em&gt; the &lt;tt&gt;com.mongodb.client.MongoClient&lt;/tt&gt; interface, so I would expect this to work.  &lt;/p&gt;

&lt;p&gt;The legacy driver probably works because &lt;tt&gt;com.mongodb.MongoClient&lt;/tt&gt; is a class, not an interface.&lt;/p&gt;

&lt;p&gt;I looked at the Tomcat documentation for &lt;a href=&quot;https://tomcat.apache.org/tomcat-4.1-doc/config/globalresources.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;GlobalNamingResource&lt;/a&gt;, and saw that the example uses the type &lt;tt&gt;javax.sql.DataSource&lt;/tt&gt;, which is also an interface, so it doesn&apos;t seem likely that interfaces are not supported at all.&lt;/p&gt;

&lt;p&gt;And here&apos;s a link to the source code: &lt;a href=&quot;https://github.com/apache/tomcat/blob/9.0.73/java/org/apache/naming/factory/ResourceLinkFactory.java#L155-L160&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/apache/tomcat/blob/9.0.73/java/org/apache/naming/factory/ResourceLinkFactory.java#L155-L160&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It looks like it is doing the right thing, so it&apos;s not clear why &lt;tt&gt;Class#isAssignableFrom&lt;/tt&gt; would return false.  The only thing I can think of is some sort of &lt;tt&gt;ClassLoader&lt;/tt&gt; issue&lt;/p&gt;</comment>
                            <comment id="5396075" author="JIRAUSER1263145" created="Tue, 2 May 2023 23:24:53 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jmclaren%40legendpower.com&quot; class=&quot;user-hover&quot; rel=&quot;jmclaren@legendpower.com&quot;&gt;jmclaren@legendpower.com&lt;/a&gt;, thank you for reporting this issue! The team will look into it and get back to you soon. &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_14266" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Documentation Changes Summary</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;1.  What would you like to communicate to the user about this feature?&lt;br/&gt;
2.  Would you like the user to see examples of the syntax and/or executable code and its output?&lt;br/&gt;
3.  Which versions of the driver/connector does this apply to?&lt;/p&gt;</customfieldvalue>

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