Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-28743

NullPointerException is thrown when trying to start Confluence 5.1 with JNDI datasource

    XMLWordPrintable

Details

    Description

      Steps to Reproduce

      1. Install a fresh Confluence 5.1 using MySQL datasouce
      2. Once the installation is completed, go to Confluence Admin > System Information and notice that the "Database Driver Name" is set to N/A, as shown in the following screenshot:
      3. Stop Confluence
      4. Start Confluence

      Expected Results

      Confluence should be able to start without any errors

      Actual Results

      Tomcat is throwing this NullPointerException instead and Confluence is not able to start

      2013-04-02 16:04:42,334 ERROR [main] [atlassian.confluence.setup.ConfluenceConfigurationListener] contextInitialized An error was encountered while bootstrapping Confluence (see below):
      null
      java.lang.NullPointerException
              at java.lang.Class.forName0(Native Method)
              at java.lang.Class.forName(Class.java:169)
              at com.atlassian.confluence.setup.DefaultBootstrapManager.isDriverPresent(DefaultBootstrapManager.java:257)
              at com.atlassian.confluence.setup.DefaultBootstrapManager.checkMySQLDriverIsPresent(DefaultBootstrapManager.java:240)
              at com.atlassian.confluence.setup.DefaultBootstrapManager.performPersistenceUpgrade(DefaultBootstrapManager.java:175)
              at com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager.init(DefaultAtlassianBootstrapManager.java:76)
              at com.atlassian.config.util.BootstrapUtils.init(BootstrapUtils.java:35)
              at com.atlassian.confluence.setup.ConfluenceConfigurationListener.initialiseBootstrapContext(ConfluenceConfigurationListener.java:90)
              at com.atlassian.confluence.setup.ConfluenceConfigurationListener.contextInitialized(ConfluenceConfigurationListener.java:46)
              at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
              at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
              at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
              at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
              at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
              at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
              at org.apache.catalina.core.StandardService.start(StandardService.java:525)
              at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
              at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
              at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
      

      Environment Information

      Confluence 5.1
      MySQL datasource (but we believe that this may occur in other databases too)

      Findings

      Confluence 5.1 and above requires hibernate.connection.driver_class property in confluence.cfg.xml when using datasource. In the previous Confluence versions, this property was not created and it was not a required property to start Confluence with datasource.

      However, in Confluence 5.1, the hibernate.connection.driver_class property is required and it's throwing NullPointerException during the Bootstrap check because it's not able to find this property

      Workaround

      1. Stop Confluence
      2. Add the following property in confluence.cfg.xml
        • MySQL
          <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
        • MS Server
          <property name="hibernate.connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property>
        • Oracle
          <property name="hibernate.connection.driver_class">oracle.jdbc.OracleDriver</property>
        • PostgreSQL
          <property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
          
      3. Start Confluence

      Attachments

        Activity

          People

            nbhawnani Niraj Bhawnani
            asanusi AmaliaA
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: