You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I would like to create a Database Connection resource in ScriptRunner for an external MySql database (our Jira instance uses a different database engine).
I have verified that all the information I entered for the connection was correct.
After entering the test SQL query [a simple SELECT COUNT(*) from MyTable], I run into this error saying "Failed to load driver class com.mysql.jdbc.Driver in either of HikariConfig class loader or Thread context classloader" (screengrab below).
Upon doing further research, I came to the conclusion that Jira probably doesn't ship with MySql driver bundled with the package. Comments on a couple of websites led me to believe that I have to download the MySql Connector RPM from Oracle's website, extract the JAR file from it, and place it in two directories (paths below) within my Jira installation directory, and that's exactly what I did.
Next thing was to restart Jira so it could pick up the new driver, but Jira failed to come up. Eventually I had to delete the MySql Connector JAR file which restored Jira back.
I examined the log file and saw a bunch of error messages:
17-Sep-2021 09:18:11.371 SEVERE [main] org.apache.catalina.core.ContainerBase.startInternal A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
... 6 more
Also worth noting is the MD5 hash comparison after downloading the MySql Connector RPM file against the hash published on Oracle's website failed. I attempted the download several times more, and it would consistently fail the comparison (and it would always be identical for each downloaded RPM).
I'd greatly appreciate any help showing me what I'm doing wrong here, and how to get the MySql Database Connection set-up properly.
Jira Version: Data Center v8.8.1
ScriptRunner Version: 6.4.0-p5
I was able to resolve this by downloading MySql Connector 5.1.49 and copying it to JIRA_INSTALLATION_DIR/lib, followed by restarting Jira.
I followed the steps outlined on https://stackoverflow.com/questions/23308493/how-to-download-mysql-jdbc-jar-file-on-centos.
Somehow, MySql Connector 8.x just wouldn't download correctly and I still don't understand why, but I'm able to connect to my database using v5.1.49 of the MySqlConnector and I'm a happy camper for now! :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.