In a case where db connection details need to be retrieved from LDAP:

      Database URL                                  : jdbc:oracle:thin:@ldap://mycompany.com:4042/cn=OracleContext,dc=mycompany,dc=com/OUR_JIRA
      

      JIRA will crash with ClassNotFoundException: com.sun.jndi.ldap.LdapCtxFactory when loading plugins:

      2011-11-16 21:09:32,967 Spring executor 4 ERROR      [plugin.osgi.factory.OsgiPlugin] Unable to start the Spring context for plugin com.atlassian.jira.plugin.ext.bamboo
      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bambooServerManager' defined in URL [bundle://31.0:0/META-INF/spring/atlassian-plugins-components.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.jira.plugin.ext.bamboo.BambooServerManagerImpl]: Constructor threw exception; nested exception is com.opensymphony.module.propertyset.PropertyImplementationException: Unable to esablish a connection with the database. (JNDI Package failure javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.ldap.LdapCtxFactory [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.ldap.LdapCtxFactory not found from bundle [com.atlassian.jira.plugin.ext.bamboo]])
      	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:254)
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925)
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835)
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
      	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
      	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
      	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
      	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
      	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
      	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
      	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
      	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)
      	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)
      	at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
      	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
      	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      	at java.lang.Thread.run(Thread.java:619)
      Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.jira.plugin.ext.bamboo.BambooServerManagerImpl]: Constructor threw exception; nested exception is com.opensymphony.module.propertyset.PropertyImplementationException: Unable to esablish a connection with the database. (JNDI Package failure javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.ldap.LdapCtxFactory [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.ldap.LdapCtxFactory not found from bundle [com.atlassian.jira.plugin.ext.bamboo]])
      	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:115)
      	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
      	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:248)
      	... 21 more
      Caused by: com.opensymphony.module.propertyset.PropertyImplementationException: Unable to esablish a connection with the database. (JNDI Package failure javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.ldap.LdapCtxFactory [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.ldap.LdapCtxFactory not found from bundle [com.atlassian.jira.plugin.ext.bamboo]])
      	at com.opensymphony.module.propertyset.ofbiz.OFBizPropertySet.findPropertyEntry(OFBizPropertySet.java:231)
      	at com.opensymphony.module.propertyset.ofbiz.OFBizPropertySet.exists(OFBizPropertySet.java:118)
      	at com.atlassian.jira.plugin.ext.bamboo.BambooServerManagerImpl.getConfigVersionNumber(BambooServerManagerImpl.java:606)
      	at com.atlassian.jira.plugin.ext.bamboo.BambooServerManagerImpl.checkUpgradeConfig(BambooServerManagerImpl.java:588)
      	at com.atlassian.jira.plugin.ext.bamboo.BambooServerManagerImpl.<init>(BambooServerManagerImpl.java:100)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)
      	... 23 more
      

      Workaround

      1. Modify $JIRA_HOME/dbconfig.xml file to not use LDAP, but directly connect to the database server using the dedicated user.
      2. Restart JIRA to pick up the changes

            [JRASERVER-26290] Plugin2 can't access JNDI when using LDAP credentials.

            Error still exists in Jira 8.17.0

            That's very sad. I cannot see why accessing a professional database via ldap is so exotic it cannot be supported properly 

            Fabian Graevenitz added a comment - Error still exists in Jira 8.17.0 That's very sad. I cannot see why accessing a professional database via ldap is so exotic it cannot be supported properly 

            John Rebelos added a comment - - edited

            we have this issue also (STILL).  we want to use ldap connection as our DB is dual instance.  Using the workaround limits us to only one instance and limits what we can do in terms of High Availability.

            John Rebelos added a comment - - edited we have this issue also (STILL).  we want to use ldap connection as our DB is dual instance.  Using the workaround limits us to only one instance and limits what we can do in terms of High Availability.

            I have the same issue with JIRA 7.3.6.

            Caused by: java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver not found by com.atlassian.activeobjects.activeobjects-plugin [17]

            pravesh.saxena added a comment - I have the same issue with JIRA 7.3.6. Caused by: java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver not found by com.atlassian.activeobjects.activeobjects-plugin [17]

            I have the same issue with Agile

            John Rebelos added a comment - I have the same issue with Agile

            I've got the same problem with FishEye

            Federico Cestonaro added a comment - I've got the same problem with FishEye

            Our customer has exactly the same root cause issue with Jira 6.0.3 (and 5.2.5 and 6.0.1)

            Caused by: java.sql.SQLRecoverableException: IO Error: JNDI Package failure javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.ldap.LdapCtxFactory [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.ldap.LdapCtxFactory not found from bundle [com.atlassian.activeobjects.activeobjects-plugin]]

            ActiveObjects plugin fails to load and triggers an avalanche of plugins not loading

            TechTime Initiative Group added a comment - Our customer has exactly the same root cause issue with Jira 6.0.3 (and 5.2.5 and 6.0.1) Caused by: java.sql.SQLRecoverableException: IO Error: JNDI Package failure javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.ldap.LdapCtxFactory [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.ldap.LdapCtxFactory not found from bundle [com.atlassian.activeobjects.activeobjects-plugin] ] ActiveObjects plugin fails to load and triggers an avalanche of plugins not loading

              Unassigned Unassigned
              bdziedzic Bogdan Dziedzic [Atlassian]
              Affected customers:
              17 This affects my team
              Watchers:
              27 Start watching this issue

                Created:
                Updated: