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

      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

        1. screenshot000.jpg
          88 kB
          AmaliaA

            [CONFSERVER-28743] NullPointerException is thrown when trying to start Confluence 5.1 with JNDI datasource

            Hi spacelysprocketslimited, this ticket is for an issue that affected Confluence 5.1.0 and was subsequently resolved in 5.1.3. If you are experiencing this with Confluence 6.7.0, it is most likely a misconfiguration. Please contact Atlassian Support for help.

            Regards,
            Niraj Bhawnani
            Development Team Lead, Confluence Server

            Niraj Bhawnani added a comment - Hi spacelysprocketslimited , this ticket is for an issue that affected Confluence 5.1.0 and was subsequently resolved in 5.1.3. If you are experiencing this with Confluence 6.7.0, it is most likely a misconfiguration. Please contact Atlassian Support for help. Regards, Niraj Bhawnani Development Team Lead, Confluence Server

            Same here.

            confluence 6.7.0

            Ubuntu 16.04.3

            Java 1.8.0_161

            SpacelySprockets added a comment - Same here. confluence 6.7.0 Ubuntu 16.04.3 Java 1.8.0_161

            Confluence 5.1.3 will contain a fix for this issue.

            Niraj Bhawnani added a comment - Confluence 5.1.3 will contain a fix for this issue.

            Amalia,

            Thanks for reminding me, I didn't pay too much attention to the contents below the stack trace

            It's an easy fix

            Deleted Account (Inactive) added a comment - Amalia, Thanks for reminding me, I didn't pay too much attention to the contents below the stack trace It's an easy fix

            AmaliaA added a comment -

            Hi i1,

            You can fix this issue by following the steps mentioned in the workaround above

            Cheers,
            Amalia

            AmaliaA added a comment - Hi i1 , You can fix this issue by following the steps mentioned in the workaround above Cheers, Amalia

            Hit exactly the same issue when upgrading 5.0.3 EAR-WAR edition to 5.1. No further information found in tomcat logs or confluence logs.

            MySQL database info:

            Database name MySQL
            Database version 5.5.29-0ubuntu0.12.04.2
            Database Dialect com.atlassian.hibernate.dialect.MySQLDialect
            Database Driver Name N/A
            Database Driver Version mysql-connector-java-5.1.24
            Database Connection URL java:comp/env/jdbc/confluence
            Database Connection Transaction Isolation Read committed
            Database Latency 0

            Expecting a fix ASAP.

            Deleted Account (Inactive) added a comment - - edited Hit exactly the same issue when upgrading 5.0.3 EAR-WAR edition to 5.1. No further information found in tomcat logs or confluence logs. MySQL database info: Database name MySQL Database version 5.5.29-0ubuntu0.12.04.2 Database Dialect com.atlassian.hibernate.dialect.MySQLDialect Database Driver Name N/A Database Driver Version mysql-connector-java-5.1.24 Database Connection URL java:comp/env/jdbc/confluence Database Connection Transaction Isolation Read committed Database Latency 0 Expecting a fix ASAP.

              nbhawnani Niraj Bhawnani
              asanusi AmaliaA
              Affected customers:
              2 This affects my team
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: