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

Error while creating a MySql Database connection resource in ScriptRunner for Jira

Kamran Ansari September 17, 2021

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).

image.png

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.

  • /jira/atlassian-jira/atlassian-jira/WEB-INF/lib
  • /jira/atlassian-jira/lib

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 java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:942)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:793)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.startup.Catalina.start(Catalina.java:688)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:353)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:493)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1423)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1413)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:953)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:882)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 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

 

Many thanks,

Kamran

2 answers

1 accepted

Suggest an answer

Log in or Sign up to answer
2 votes
Answer accepted
Kamran Ansari September 18, 2021

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! :)

Kamran 

0 votes
Damon Graymark March 28, 2024

Sorry to hear about the trouble you're facing with setting up the MySQL database connection in ScriptRunner for Jira. It sounds like you've double-checked everything, but sometimes these errors can be tricky to pinpoint.

On a different note, have you considered exploring options like Sacramento Web Design services? They specialize in WordPress management, ensuring your website stays secure and up to date. It could be a valuable resource to streamline your online presence while you troubleshoot technical challenges. Best of luck getting everything sorted out!

TAGS
AUG Leaders

Atlassian Community Events