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

I am upgrading springboot 2.7.12 to 3.1.4 and java 8 to java 17 #3794

Closed
7Mayuri opened this issue Nov 9, 2023 · 1 comment
Closed

I am upgrading springboot 2.7.12 to 3.1.4 and java 8 to java 17 #3794

7Mayuri opened this issue Nov 9, 2023 · 1 comment

Comments

@7Mayuri
Copy link

7Mayuri commented Nov 9, 2023

Which version and edition of Flyway are you using?

"org.flywaydb:flyway-core:9.16.3"

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)

I tried with the latest version 10.0.0 but there I was getting an another issue

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

Gradle (Intelij)

Which database are you using? (Type & version)

Mysql and h2 database (for test cases )

Which operating system are you using?

windows 11

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)

I have tried to upgrade the flyway version to 10.0.0 upgrade flway-core and flyway-mysql version also

this error comes:

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$FlywayConfiguration.configureProperties(FlywayAutoConfiguration.java:254)

The following method did not exist:

'org.flywaydb.core.api.configuration.FluentConfiguration org.flywaydb.core.api.configuration.FluentConfiguration.licenseKey(java.lang.String)'

The calling method's class, org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$FlywayConfiguration, was loaded from the following location:

jar:file:/C:/Users/Z004R2WZ/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-autoconfigure/3.1.4/ae53253f6330787f8b77a13aa90d6514597a20d0/spring-boot-autoconfigure-3.1.4.jar!/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class

The called method's class, org.flywaydb.core.api.configuration.FluentConfiguration, is available from the following locations:

jar:file:/C:/Users/Z004R2WZ/.gradle/caches/modules-2/files-2.1/org.flywaydb/flyway-core/10.0.0/68984a8022f0daf4220a2e1605547684bea1e193/flyway-core-10.0.0.jar!/org/flywaydb/core/api/configuration/FluentConfiguration.class

The called method's class hierarchy was loaded from the following locations:

org.flywaydb.core.api.configuration.FluentConfiguration: file:/C:/Users/Z004R2WZ/.gradle/caches/modules-2/files-2.1/org.flywaydb/flyway-core/10.0.0/68984a8022f0daf4220a2e1605547684bea1e193/flyway-core-10.0.0.jar

Action:

Correct the classpath of your application so that it contains compatible versions of the classes org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$FlywayConfiguration and org.flywaydb.core.api.configuration.FluentConfiguration

What did you expect to see?

DB Migration to be successful, as it was in 8.5.13.

What did you see instead?

ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Migration V1_0__init.sql failed

SQL State : 42000
Error Code : 42000
Message : Syntax error in SQL statement "-- SET sql_mode = '';\000d\000acreate table installation(\000d\000a id character varying(36) not null,\000d\000a provider_id character varying(36) not null,\000d\000a app_id character varying(36) not null,\000d\000a app_name character varying(255),\000d\000a display_name character varying(255),\000d\000a app_version_id character varying(36),\000d\000a version character varying(255),\000d\000a app_type character varying(255),\000d\000a valid_from timestamp,\000d\000a valid_to timestamp,\000d\000a configuration character varying(2000),\000d\000a row_version int not null default 1,\000d\000a primary key (id),\000d\000a constraint uk_provider__app_name__version unique (provider_id, app_name, version)\000d\000a) [*]ROW_FORMAT=DYNAMIC"; SQL statement:
-- SET sql_mode = '';
create table installation(
id character varying(36) not null,
provider_id character varying(36) not null,
app_id character varying(36) not null,
app_name character varying(255),
display_name character varying(255),
app_version_id character varying(36),
version character varying(255),
app_type character varying(255),
valid_from timestamp,
valid_to timestamp,
configuration character varying(2000),
row_version int not null default 1,
primary key (id),
constraint uk_provider__app_name__version unique (provider_id, app_name, version)
) ROW_FORMAT=DYNAMIC [42000-224]
Location : aws/db/migration/V1_0__init.sql (C:\springboot upgrade\pleaseeee\core\build\resources\main\aws\db\migration\V1_0__init.sql)
Line : 2
Statement : -- SET sql_mode = '';
create table installation(
id character varying(36) not null,
provider_id character varying(36) not null,
app_id character varying(36) not null,
app_name character varying(255),
display_name character varying(255),
app_version_id character varying(36),
version character varying(255),
app_type character varying(255),
valid_from timestamp,
valid_to timestamp,
configuration character varying(2000),
row_version int not null default 1,
primary key (id),
constraint uk_provider__app_name__version unique (provider_id, app_name, version)
) ROW_FORMAT=DYNAMIC

@JasonLuo-Redgate
Copy link

Hi @7Mayuri , the missing licenseKey method error is an known issue tracked through spring-projects/spring-boot#38164.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants