docs
docs copied to clipboard
Rundeck spring cannot load mysql driver even after put jar to /var/lib/rundeck/lib
Describe the bug Recently we upgraded MySQL from 5.7 to 8.0.32, so I am following this guide to upgrade mysql connector https://docs.rundeck.com/docs/administration/configuration/database/mysql.html#configuring-rundeck I downloaded the jar package from maven: https://mvnrepository.com/artifact/com.mysql/mysql-connector-j/8.0.33 the source link: https://repo1.maven.org/maven2/com/mysql/mysql-connector-j/8.0.33/mysql-connector-j-8.0.33.jar then put this jar file to folder: /var/lib/rundeck/lib changed owner to rundeck [rundeck@rundeck-bdpcn cli]$ ls -atrl /var/lib/rundeck/lib total 2460 -rwxr-xr-x 1 rundeck rundeck 2515447 Jul 3 06:34 mysql-connector-j-8.0.31.jar drwxr-xr-x 2 rundeck rundeck 42 Jul 3 06:35 . drwxrwxr-x 1 rundeck rundeck 134 Jul 3 06:42 ..
then changed rundeck-config.properties [rundeck@rundeck-bdpcn rundeck]$ cat rundeck-config.properties #loglevel.default is the default log level for jobs: ERROR,WARN,INFO,VERBOSE,DEBUG loglevel.default=INFO rdeck.base=/var/lib/rundeck
#rss.enabled if set to true enables RSS feeds that are public (non-authenticated) rss.enabled=false #change hostname here grails.serverURL=https://server.com
dataSource.driverClassName=com.mysql.cj.jdbc.Driver dataSource.url = jdbc:mysql://server_host/rundeck?autoReconnect=true dataSource.username = rundeck dataSource.password = pw_hashed
error message after restart rundeck container:
org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:|PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'driverClassName' threw exception; nested exception is java.lang.IllegalStateException: Could not load JDBC driver class [com.mysql.cj.jdbc.Driver]
at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:788)
at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:434)
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:780)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:284)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1322)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:732)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:490)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:118)
at org.eclipse.jetty.server.Server.start(Server.java:342)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:100)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:60)
at org.eclipse.jetty.server.Server.doStart(Server.java:290)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
at com.dtolabs.rundeck.RunServer.run(RunServer.java:128)
at com.dtolabs.rundeck.RunServer.main(RunServer.java:81)
2023-07-03 06:36:17.173:INFO:oejs.ServerConnector:main: Started ServerConnector@7ed3df3b{HTTP/1.1}{0.0.0.0:4440}
please let me know how to fix the problem? thanks a lot!
Source page https://docs.rundeck.com/docs/administration/configuration/database/mysql.html#configuring-rundeck