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

NoSuchMethodError thrown by v10.0.0 when test suite runs #3781

Closed
donalmurtagh opened this issue Nov 1, 2023 · 4 comments
Closed

NoSuchMethodError thrown by v10.0.0 when test suite runs #3781

donalmurtagh opened this issue Nov 1, 2023 · 4 comments
Labels
s: blocked Blocked on 3rd party work

Comments

@donalmurtagh
Copy link

donalmurtagh commented Nov 1, 2023

Which version and edition of Flyway are you using?

10.0.0

If this is not the latest version, can you reproduce the issue with the latest one as well? (Many bugs are fixed in newer releases and upgrading will often resolve the issue)

N/A

Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)

Gradle

Which database are you using? (Type & version)

Postgres v11

Which operating system are you using?

Mac OS X

What did you do? (Please include the content causing the issue, any relevant configuration settings, the SQL statement(s) that failed (if any), and the command you ran)

Changed build.gradle from v9.22.3 to v10.0.0 i.e.

plugins {
    id 'org.flywaydb.flyway' version '10.0.0' // was 9.22.3
}

dependencies {
    implementation "org.flywaydb:flyway-core:10.0.0" // was 9.22.3
    implementation "org.flywaydb:flyway-database-postgresql:10.0.0" // new dependency added during v10.0.0 upgrade
}
What did you expect to see?

The test suite should run without any errors (the app itself starts without any errors).

What did you see instead?

When I run the test suite of the (Spring Boot) app via ./gradlew test, every test fails due to the following error

  Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flyway' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Failed to instantiate [org.flywaydb.core.Flyway]: Factory method 'flyway' threw exception with message: 'org.flywaydb.core.api.configuration.FluentConfiguration org.flywaydb.core.api.configuration.FluentConfiguration.licenseKey(java.lang.String)'
  Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.flywaydb.core.Flyway]: Factory method 'flyway' threw exception with message: 'org.flywaydb.core.api.configuration.FluentConfiguration org.flywaydb.core.api.configuration.FluentConfiguration.licenseKey(java.lang.String)'
  Caused by: java.lang.NoSuchMethodError: 'org.flywaydb.core.api.configuration.FluentConfiguration org.flywaydb.core.api.configuration.FluentConfiguration.licenseKey(java.lang.String)'

I'm using the community edition of Flyway, so I would not expect to have to configure a license key. My Flyway configuration (in build.gradle) is shown below

flyway {
    url = "jdbc:postgresql://0.0.0.0:5432/postgres"
    user = "postgres"
    password = "secret"
}
@donalmurtagh donalmurtagh changed the title NoSuchMethodError thrown by v10.0.0 when test suite runs NoSuchMethodError thrown by v10.0.0 when test suite runs Nov 1, 2023
@JasonLuo-Redgate
Copy link

Hi @donalmurtagh , a spring-boot issue has been raised for this: spring-projects/spring-boot#38164

@donalmurtagh
Copy link
Author

donalmurtagh commented Nov 2, 2023

@JasonLuo-Redgate Thanks for your reply. This is the second time this has happened recently i.e. that a Flyway release is incompatible with the latest release of Spring Boot. I understand that the Spring support is not controlled by Flyway, but given the popularity of Spring Boot, shouldn't this be tested and mentioned in the release notes if there's an incompatibility?

@Barry-RG
Copy link
Contributor

Barry-RG commented Nov 2, 2023

@donalmurtagh we are currently reviewing and planning how to be more active on this front. For a while now Flyways configuration has been pretty static with the exceptions of additions. However, recently to make flyway more open and expandable we have had to make a lot of changes to our configuration models which have caused this incompatibility. We are going to improve this by working more with partially the spring boot code base to improve these transitions but we are not there yet. Thank you for any patients.

@JasonLuo-Redgate JasonLuo-Redgate added s: blocked Blocked on 3rd party work and removed s: waiting for feedback labels Nov 2, 2023
@JasonLuo-Redgate
Copy link

The Sprint boot ticket is now fixed spring-projects/spring-boot#38164

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s: blocked Blocked on 3rd party work
Projects
None yet
Development

No branches or pull requests

3 participants