Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-3155

JNDI ObjectFactory Broken for Tomcat

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.9.1
    • Component/s: API
    • Labels:
      None

      When entering into `getObjectInstance()` method for `ObjectFactory` implementations, Tomcat / TomEE is not using `environment`, so it gets passed in as `null`. A quick fix to this bug would be to check if `environment` is null before trying to access the hashtable.

      Example Stack Trace:

      29-Jan-2019 11:39:54.452 SEVERE [localhost-startStop-1] org.apache.tomee.catalina.TomcatResourceFactory.create Can't create resource null
       java.lang.NullPointerException
      	at com.mongodb.client.jndi.MongoClientFactory.getObjectInstance(MongoClientFactory.java:72)
      ...
      

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            james-r-smith James Smith
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: