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

Unable to create/edit page after a fresh installation of Confluence with MS SQL Server. Synchrony could not load driverClass net.sourceforge.jtds.jdbc.Driver

      STEPS TO REPLICATE

      1. Install Confluence version 6.4.2 (using atlassian-confluence-6.4.2.tar.gz for this test)
      2. During the database setup, Driver Class Name is automatically set to use com.microsoft.sqlserver.jdbc.SQLServerDriver as per screenshot below:
      3. Enter the database URL and credential.
      4. Complete the installation.

      EXPECTED BEHAVIOUR
      User able to create a page after the installation.

      ACTUAL BEHAVIOUR
      Stack trace below appear in Confluence <HOME_directory>/logs/atlassian-synchrony.log:

      2017-10-20 21:40:11,815 DEBUG [197:StdOutHandler [/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/jre/bin/java]] Could not load driverClass net.sourceforge.jtds.jdbc.Driver
      2017-10-20 21:40:11,815 DEBUG [197:StdOutHandler [/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/jre/bin/java]] java.lang.ClassNotFoundException: net.sourceforge.jtds.jdbc.Driver
      

      User unable to create/edit page:

      WORKAROUND
      update the jtds url to a correctly formatted Microsoft SQL Server driver url as per their documentation (https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url) :

      1. Stop Confluence
      2. Navigate to Confluence <HOME_directory>/confluence.cfg.xml file and replace the line below:
        <property name="hibernate.connection.url">jdbc:jtds:sqlserver://localhost:1433/confluence</property>
        

        with:

        <property name="hibernate.connection.url">jdbc:sqlserver://localhost:1433;databaseName=confluence</property>
        
      1. Start Confluence

        1. databasesetup.png
          databasesetup.png
          149 kB
        2. erroredit.png
          erroredit.png
          21 kB
        3. mssql-jdbc.PNG
          mssql-jdbc.PNG
          24 kB

          Form Name

            [CONFSERVER-53993] Unable to create/edit page after a fresh installation of Confluence with MS SQL Server. Synchrony could not load driverClass net.sourceforge.jtds.jdbc.Driver

            Verified this is no longer an issue in Confluence 6.5.0. If you are still using the JTDS Driver, you will need to switch to the Microsoft Driver now, or after Confluence 6.5.0. For more information about migrating to the Microsoft SQL Server Driver, https://confluence.atlassian.com/confkb/migrate-from-the-jtds-driver-to-the-supported-microsoft-sql-server-driver-in-confluence-6-4-or-later-939505122.html.

            Alex Yakovlev (Inactive) added a comment - - edited Verified this is no longer an issue in Confluence 6.5.0. If you are still using the JTDS Driver, you will need to switch to the Microsoft Driver now, or after Confluence 6.5.0. For more information about migrating to the Microsoft SQL Server Driver,  https://confluence.atlassian.com/confkb/migrate-from-the-jtds-driver-to-the-supported-microsoft-sql-server-driver-in-confluence-6-4-or-later-939505122.html .

            In Confluence 6.5, the user is no longer prompted to enter the database driver directly so this should no longer be an issue there.

            Alex Yakovlev (Inactive) added a comment - In Confluence 6.5, the user is no longer prompted to enter the database driver directly so this should no longer be an issue there.

            riyaazsahabodien1487518041, have you already troubleshooted your issue with our Support Team? If not, please raise a Support request as there are possibly other factors that could be contributing to these issues. You may contact our Support Team here: https://support.atlassian.com/contact

            Alex Yakovlev (Inactive) added a comment - - edited riyaazsahabodien1487518041 , have you already troubleshooted your issue with our Support Team? If not, please raise a Support request as there are possibly other factors that could be contributing to these issues. You may contact our Support Team here:  https://support.atlassian.com/contact

            I tested out the above on our DEV server as we seem to be experiencing the same issue? After updating the above after following the instructions it did not work for me thoguh

            Riyaaz Sahabodien added a comment - I tested out the above on our DEV server as we seem to be experiencing the same issue? After updating the above after following the instructions it did not work for me thoguh

            Chii (Inactive) added a comment - - edited

            The problem is caused by the user entering a JTDS jdbc url, rather than a Microsoft SQL Server jdbc url. Notice the `jtds` in the url field in the screenshot.

            The 'test connection' button works due to Confluence shipping both the JTDS drivers and the MS SQL drivers. Prior to 6.4.x, Confluence only ship the JTDS drivers, hence this issue didn't surface.The setup connection test should fail when using a mismatched urls and driver class.

            Best workaround is to change the jdbc url to one consistent with Microsoft's documentation (see https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url ), since JTDS is a deprecated driver.

            Chii (Inactive) added a comment - - edited The problem is caused by the user entering a JTDS jdbc url, rather than a Microsoft SQL Server jdbc url. Notice the `jtds` in the url field in the screenshot. The 'test connection' button works due to Confluence shipping both the JTDS drivers and the MS SQL drivers. Prior to 6.4.x, Confluence only ship the JTDS drivers, hence this issue didn't surface.The setup connection test should fail when using a mismatched urls and driver class. Best workaround is to change the jdbc url to one consistent with Microsoft's documentation (see https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url ), since JTDS is a deprecated driver.

              alyakovlev Alex Yakovlev (Inactive)
              dazmi Dayana
              Affected customers:
              3 This affects my team
              Watchers:
              12 Start watching this issue

                Created:
                Updated:
                Resolved: