Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Jira plugin accessing external MySQL db

Alex Perez
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.
September 30, 2013

Hi folks,

We are working to get a Jira Report that calculates a SLA, and among other things it needs to check if a day was working day against a holidays calendar stored in our CMDB.

Using jira 5.2, on tomcat 7.0.29 and oracle 11gR2. The CMDB is using MySQL, and no matter where I deploy the mysql jdbc driver, the plugin code seems unable to load the class ...

Already tried TOMCAT_HOME/lib and webapps/atlassian-jira/WEB-INF/lib, but always is throwing the same error:

"ClassNotFoundException: com.mysql.jdbc.Driver"

At this moment, the connection is being opened when the report is called (provisionally). Should I provide the driver with the plugin? I read something in atlassian wiki about classloader with the plugin system, but I can't remember the exact problem ...

The code in the report is:

Class.forName("com.mysql.jdbc.Driver"); // ClassNotFoundException!
Properties connectionProps = new Properties();
connectionProps.put("user", "user");
connectionProps.put("password", "the_pass");
String url = "jdbc:mysql://dbhost.com:3306/db";
c = DriverManager.getConnection(url, connectionProps);

Thanks in advance

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Alex Perez
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.
February 5, 2014

for the record, the problem is solved when adding this section to pom.xml:

<dependency>
	<groupId>mysql</groupId>
	<artifactId>mysql-connector-java</artifactId>
	<version>5.1.29</version>
</dependency>

HTH

0 votes
RambanamP
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.
September 30, 2013

i also faced same problem later used to connect with external databse using JNDI configuration

TAGS
AUG Leaders

Atlassian Community Events