plugin cannot locate database driver since Jira 4.4 upgrade

John Price
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 1, 2011

I have a plugin that uses the SQL Server driver to access a database. After upgrading to Jira 4.4 from 4.1, it no longer works. The error is the same one that I found here (unanswered): https://answers.atlassian.com/questions/5372/java-sql-sqlexception-no-suitable-driver-found-for-jdbc-sqlserver

This is a plugin that did not change at all. It uses the jtds driver in the Tomcat lib folder at Atlassian JIRA lib which is the same location it was in in my old JIRA install (well, Atlassian JIRA 4.1.2 lib). I see that the driver version changed, but that shouldn't matter as far as I can see.

I was unable to find anything in the release notes for 4.4 about changes to the way jars are loaded/path resolution/etc. I have zero idea how I might troubleshoot this.

Exact error is:

ERROR ServiceRunner EmailTicket jira.plugins.mycompany.UpdateStringFieldFromDatabaseListener No suitable driver found for jdbc:jtds:sqlserver://sqlserverl:1433/MyDatabase

1 answer

1 accepted

1 vote
Answer accepted
John Price
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 6, 2011

I resolved this myself eventually. See also https://answers.atlassian.com/questions/5372/java-sql-sqlexception-no-suitable-driver-found-for-jdbc-sqlserver ... it's probably the same thing.

I'm not a Java developer (other than my one internal plugin), but it looks like something changed between 4.1 and 4.4 that causes the jdbc drivers used by Jira itself to not be available to plugins with a simple

return DriverManager.getConnection(m_connectString, m_username, m_password);

I had to do two things:

1) Explicitly load the driver myself with

Class.forName("net.sourceforge.jtds.jdbc.Driver");

2) Package the jtds driver with my plugin instead of using Jira's version by adding it as a Resource in Eclipse and adding the following to the pom.xml file:

<dependency>
<groupId>net.sourceforge.jtds</groupId>
<artifactId>jtds</artifactId>
<version>1.2.4</version>
<scope>compile</scope>
</dependency>

Not sure what changed, but that worked for me.

Suggest an answer

Log in or Sign up to answer