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
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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.