Add Profile for Microsoft SQL Server using SQL for Confluence
This article provides steps for pre-checking the connection and instructions to add a profile with database type - Microsoft SQL Server.
Instructions
If you are observing the below error in the log (atlassian-confluence.log) files, perform the pre-checks that are mentioned below:
driverClass : com.microsoft.sqlserver.jdbc.SQLServerDriver dbJar : /atlassian/sqlDrivers/sqljdbc4x.jar dburl : jdbc:sqlserver://hostnameorIP:port;database=DbName username : user dataSourceName : caused by: javax.servlet.ServletException: Servlet execution threw an exception at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:234) caused by: java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:4098)
Pre-Checks:
If the Confluence instance is upgraded to any of the latest versions, i.e.,7.13.1 or higher, ensure the old( before upgrade) and new (after upgrade) Java files are not in the same place. If the files are located in the same place, then stop the Confluence, remove old files and restart the Confluence.
- Make sure the plugin is up-to-date.
- Use the maven link in the Driver JAR location instead of the path to the driver jar. The compatible jar versions are available here: https://repo1.maven.org/maven2/com/microsoft/sqlserver/mssql-jdbc/. Navigate to the respective jar version, use the link, and test the connection. If it works, then download the jar version from the same maven link and place it under the /<confluence-Installation-directory>/confluence/WEB-INF/lib.
- If you still observe the error as shown in the picture, then follow the below given instructions:
Add the below JVM parameter line in setenv.sh file under: <Confluence_installation_directory>/bin/setenv.sh or <Confluence_installation_directory>/bin/setenv.bat, if it is Windows.
CATALINA_OPTS="-Dadd-modules=java.xml.bind ${CATALINA_OPTS}"
- After adding this entry, restart the Confluence and validate the SQL Pro profile against your SQL Server database.
- If you are still facing an issue, and your current java version is 1.11, then make it to 1.8 and re-check the connection.
- Before proceeding with changes in production, perform all pre-checks and instructions in the staging instance first.
- Sample maven link: https://repo1.maven.org/maven2/com/microsoft/sqlserver/mssql-jdbc/7.2.2.jre11/mssql-jdbc-7.2.2.jre11.jar
- Refer to the profile configurations page Example profile configurations
- For Windows, ensure that all the updates on Windows Server are updated. Please check first on Stage Server or consult your administrator.