Jira CLI: No suitable driver

Thomas Leupold May 14, 2012

We are new to jira and did some first steps with the command line interfces

We installed jira 5.0.1 and atlassian-cli-2.5.0. The jira database is a mysql database (5.0.95). When we try to run the following command:

jira.sh --user <user> --password <password> --server http://nbg1jira1.nashtech.grp:8080 --url http://nbg1jira1.nashtech.grp:8080 --action runFromSql --file "User.sql" --database jira --dbUser <dbuser> --dbPassword <dbpassword> -v --driver "mysql"

Server address: http://nbg1jira1.nashtech.grp:8080/rpc/soap/jirasoapservice-v2
Successful
login to: http://nbg1jira1.nashtech.grp:8080/rpc/soap/jirasoapservice-v2 by user: <user>
9sDT5EXmK5 logged out.

Client error: Could not load database driver: com.mysql.jdbc.Driver. Ensure the jdbc driver is available in the lib/jdbc directory.
org.swift.common.cli.CliClient$ClientException: Could not load database driver: com.mysql.jdbc.Driver. Ensure the jdbc driver is available in the lib/jdbc directory.
at org.swift.common.cli.CliUtils.getDatabaseConnection(CliUtils.java:390)
at org.swift.common.cli.CliClient.getDatabaseConnectionFromParameters(CliClient.java:1271)
at org.swift.common.cli.CliClient.runFromSql(CliClient.java:947)
at org.swift.jira.cli.JiraClient.handleRequest(JiraClient.java:419)
at org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:119)
at org.swift.common.cli.CliClient.doWork(CliClient.java:299)
at org.swift.jira.cli.JiraClient.main(JiraClient.java:146)

I downloaded from the mysql web site the file mysql-connector-java-5.1.10.jar into <cli-root>/lib/jdbc, but then I will get another error when I run the previous command:

Server address: http://nbg1jira1.nashtech.grp:8080/rpc/soap/jirasoapservice-v2
Successful login to: http://nbg1jira1.nashtech.grp:8080/rpc/soap/jirasoapservice-v2 by user: <user>
lbp2HUkn8s logged out.

Client error: Exception getting database connection: No suitable driver
org.swift.common.cli.CliClient$ClientException: Exception getting database connection: No suitable driver
at org.swift.common.cli.CliUtils.getDatabaseConnection(CliUtils.java:392)
at org.swift.common.cli.CliClient.getDatabaseConnectionFromParameters(CliClient.java:1271)
at org.swift.common.cli.CliClient.runFromSql(CliClient.java:947)
at org.swift.jira.cli.JiraClient.handleRequest(JiraClient.java:419)
at org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:119)
at org.swift.common.cli.CliClient.doWork(CliClient.java:299)
at org.swift.jira.cli.JiraClient.main(JiraClient.java:146)

What might be wrong in the installation/query?

5 answers

1 accepted

0 votes
Answer accepted
Thomas Leupold May 15, 2012

The jdbc driver is working. The error comes from the url option. The url below solves my issue:

--url jdbc:mysql://<host>/jira

parthiban subramaniam
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.
May 15, 2012

Glad you resolved it

0 votes
Thomas Leupold May 14, 2012

I already download the mysql JDBC driver and copied it into lib/jdbc. Now I get another error:

Client error: Exception getting database connection: No suitable driver
org.swift.common.cli.CliClient$ClientException: Exception getting database connection: No suitable driver
at org.swift.common.cli.CliUtils.getDatabaseConnection(CliUtils.java:392)
at org.swift.common.cli.CliClient.getDatabaseConnectionFromParameters(CliClient.java:1271)
at org.swift.common.cli.CliClient.runFromSql(CliClient.java:947)
at org.swift.jira.cli.JiraClient.handleRequest(JiraClient.java:419)
at org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:119)
at org.swift.common.cli.CliClient.doWork(CliClient.java:299)
at org.swift.jira.cli.JiraClient.main(JiraClient.java:146)

0 votes
Thomas Leupold May 14, 2012

I already download different version of the mysql JDBC driver. The JDBC driver works will in other applications, e.g. DbVisualizer.When I copy the JDBC driver in the cli lib folder and run the query again, then I will get the the error:

Client error: Exception getting database connection: No suitable driver
org.swift.common.cli.CliClient$ClientException: Exception getting database connection: No suitable driver
at org.swift.common.cli.CliUtils.getDatabaseConnection(CliUtils.java:392)
at org.swift.common.cli.CliClient.getDatabaseConnectionFromParameters(CliClient.java:1271)
at org.swift.common.cli.CliClient.runFromSql(CliClient.java:947)
at org.swift.jira.cli.JiraClient.handleRequest(JiraClient.java:419)
at org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:119)
at org.swift.common.cli.CliClient.doWork(CliClient.java:299)
at org.swift.jira.cli.JiraClient.main(JiraClient.java:146)

0 votes
parthiban subramaniam
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.
May 14, 2012

Just checked

https://plugins.atlassian.com/plugins/org.swift.jira.cli

and

https://plugins.atlassian.com/plugins/org.swift.atlassian.cli

First one does not have any JDBC drivers packaged and Atlassian tool has postgress JDBC drivers. You are trying to use MYSQL you need to copy download and copy them in the lib folders where you have unzipped this tool or provide it in the class path

Thomas Leupold May 14, 2012

I alreay download the mysql JDBC driver and copied it into lib/jdbc. Now I get another error:

lient error: Exception getting database connection: No suitable driver
org.swift.common.cli.CliClient$ClientException: Exception getting database connection: No suitable driver
at org.swift.common.cli.CliUtils.getDatabaseConnection(CliUtils.java:392)
at org.swift.common.cli.CliClient.getDatabaseConnectionFromParameters(CliClient.java:1271)
at org.swift.common.cli.CliClient.runFromSql(CliClient.java:947)
at org.swift.jira.cli.JiraClient.handleRequest(JiraClient.java:419)
at org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:119)
at org.swift.common.cli.CliClient.doWork(CliClient.java:299)
at org.swift.jira.cli.JiraClient.main(JiraClient.java:146)

Thomas Leupold May 14, 2012

The same JDBC driver works will with other applications, e.g. DbVisualizer.

Thomas Leupold May 14, 2012

I already download the mysql JDBC driver and copied it into lib/jdbc. Now I get another error:

Client error: Exception getting database connection: No suitable driver
org.swift.common.cli.CliClient$ClientException: Exception getting database connection: No suitable driver
at org.swift.common.cli.CliUtils.getDatabaseConnection(CliUtils.java:392)
at org.swift.common.cli.CliClient.getDatabaseConnectionFromParameters(CliClient.java:1271)
at org.swift.common.cli.CliClient.runFromSql(CliClient.java:947)
at org.swift.jira.cli.JiraClient.handleRequest(JiraClient.java:419)
at org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:119)
at org.swift.common.cli.CliClient.doWork(CliClient.java:299)
at org.swift.jira.cli.JiraClient.main(JiraClient.java:146)

Thomas Leupold May 14, 2012

The same JDBC driver works well with other applications, e.g. DbVisualizer.

0 votes
parthiban subramaniam
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.
May 14, 2012

There is nothing wrong with your installation.

CLI tool requires JDBC drivers in your class path which is not packaged along with it.

Download mysql jdbc drivers and copy it under the lib folder of your CLI tool that will resolve this issue

Suggest an answer

Log in or Sign up to answer