Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using MySQL driver fails when using Liquibase Maven plugin #66

Closed
kuma-blue opened this issue Feb 25, 2022 · 1 comment
Closed

Using MySQL driver fails when using Liquibase Maven plugin #66

kuma-blue opened this issue Feb 25, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@kuma-blue
Copy link

kuma-blue commented Feb 25, 2022

Trying to use the MySQL driver to grab our secrets from AWS using the Maven Liquibase plugin and I keep getting this error:

[ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:4.7.1:status (default-cli) on project smart-is:
[ERROR] Error setting up or running Liquibase:
[ERROR] liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: java.lang.IllegalStateException: No Driver has been registered with name, com.mysql.cj.jdbc.Driver. Please check your system properties or secretsmanager.properties for typos. Also ensure that the Driver registers itself.

I went with the solution as described in Issue #47 where you write your own custom SecretsManager driver and make sure that the driver registers itself. Basically I had changed AWSSecretsManagerMySQLDriver.getDefaultDriverClass() line #132 to:

 Class.forName("com.mysql.cj.jdbc.Driver", true, this.getClass().getClassLoader());

My Liquibase config is as follows (defined in our pom.xml):

	<plugin>
		<groupId>org.liquibase</groupId>
		<artifactId>liquibase-maven-plugin</artifactId>
		<version>4.7.1</version>
		<configuration>
			<driver>com.amazonaws.secretsmanager.sql.AWSSecretsManagerMySQLDriver</driver>
			<username>{AWS secrets name}</username>
			<url>jdbc-secretsmanager:mysql://{path to our DB}</url>
			<changeLogFile>{location of our changeset file}</changeLogFile>
		</configuration>
	</plugin>

Can someone confirm/fix this issue? Having to extend AWSSecretsManagerDriver is a hacky way of doing things...

@simonmarty simonmarty added the bug Something isn't working label May 10, 2022
@jbct
Copy link

jbct commented Nov 14, 2022

Closing as a duplicate of #44. Working all of the tickets related to "No Driver has been registered with name" together.

@jbct jbct closed this as completed Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants