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

Add support for org.flywaydb:flyway-core:10.0.0 #424

Open
wetted opened this issue Nov 21, 2023 · 7 comments
Open

Add support for org.flywaydb:flyway-core:10.0.0 #424

wetted opened this issue Nov 21, 2023 · 7 comments
Labels
enhancement New feature or request

Comments

@wetted
Copy link

wetted commented Nov 21, 2023

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

The graalvm-reachability-metadata supports org.flywaydb 9.0.1, but is broken for flyway 10.0.0
/~https://github.com/oracle/graalvm-reachability-metadata/tree/master/metadata/org.flywaydb/flyway-core

Describe the solution you'd like
A clear and concise description of what you want to happen.

  • add support for org.flywaydb:flyway-core:10.0.0
  • add support for org.flywaydb:flyway-sqlserver:10.0.0
  • add support for org.flywaydb:flyway-database-oracle:10.0.0
  • add support for org.flywaydb:flyway-database-postgresql:10.0.0

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

  • null

Additional context
Add any other context or screenshots about the feature request here.

  | Caused by: org.graalvm.nativeimage.MissingReflectionRegistrationError: The program tried to reflectively invoke method public java.lang.String org.flywaydb.core.internal.command.clean.CleanModeConfigurationExtension.getNamespace() without it being registered for runtime reflection. Add public java.lang.String org.flywaydb.core.internal.command.clean.CleanModeConfigurationExtension.getNamespace() to the reflection metadata to solve this problem. See https://www.graalvm.org/latest/reference-manual/native-image/metadata/#reflection for help. |  
/~https://github.com/micronaut-projects/micronaut-flyway/actions/runs/6935025730/job/18864351069?pr=472

@mhalbritter
Copy link
Collaborator

mhalbritter commented Aug 30, 2024

Flyway fails with Spring Boot 3.4.0-M2 which uses Flyway 10.17.1:

Caused by: org.graalvm.nativeimage.MissingReflectionRegistrationError: The program tried to reflectively invoke method public boolean org.flywaydb.core.internal.publishing.PublishingConfigurationExtension.isPublishResult() without it being registered for runtime reflection. Add public boolean org.flywaydb.core.internal.publishing.PublishingConfigurationExtension.isPublishResult() to the reflection metadata to solve this problem. See https://www.graalvm.org/latest/reference-manual/native-image/metadata/#reflection for help.
at org.graalvm.nativeimage.builder/com.oracle.svm.core.reflect.MissingReflectionRegistrationUtils.forQueriedOnlyExecutable(MissingReflectionRegistrationUtils.java:72)
at java.base@21.0.3/java.lang.reflect.Method.acquireMethodAccessor(Method.java:77)

@mhalbritter mhalbritter self-assigned this Sep 4, 2024
@mhalbritter
Copy link
Collaborator

I've added metadata for Flyway 10.17.1 in #531.

@mhalbritter mhalbritter removed their assignment Sep 4, 2024
@asm0dey
Copy link

asm0dey commented Dec 5, 2024

With 10.20.1 and spring 3.4.0 it fails with

The program tried to reflectively invoke method

   public java.lang.String org.flywaydb.core.internal.configuration.extensions.DeployScriptFilenameConfigurationExtension.getScriptFilename()

 without it being registered for runtime reflection.

@mhalbritter
Copy link
Collaborator

mhalbritter commented Dec 6, 2024

This can be fixed by using the latest version of the reachability metadata:

graalvmNative {
	metadataRepository {
		version = '0.3.15'
	}
}

or

<plugin>
	<groupId>org.graalvm.buildtools</groupId>
	<artifactId>native-maven-plugin</artifactId>
	<configuration>
		<metadataRepository>
			<version>0.3.15</version>
		</metadataRepository>
	</configuration>
</plugin>

@msosa
Copy link

msosa commented Dec 23, 2024

Upgrading to Spring Boot 3.4.1 did not seem to fix it for me. The location of my error seems a little different than the others I see here though:

Caused by: org.graalvm.nativeimage.MissingReflectionRegistrationError: The program tried to reflectively invoke method public boolean org.flywaydb.core.internal.publishing.PublishingConfigurationExtension.isCheckDriftOnMigrate() without it being registered for runtime reflection.

@mhalbritter
Copy link
Collaborator

Spring Boot 3.4.1 will use the latest Native Build Tools release, which includes this reachability metadata version by default.

This isn't true, sorry!

Spring Boot 3.4.1 uses Native Build Tools 0.10.4, which uses the 0.3.14 metadata.

So the workaround from #424 (comment) still applies to Spring Boot 3.4.1.

@goafabric
Copy link

goafabric commented Jan 8, 2025

I am having the same problem since boot 3.4x with PublishingConfigurationExtension,
and also since 3.3 there is a similar problem with "TransactionalModel" if flyway is combined with Hibernate.

The following Spring annotations would fix it, i think this could be easily translated to graalvm defaults.
And I understand the workaround that Moritz mentioned concerning the first issue.

@RegisterReflection(classes = {org.flywaydb.core.internal.publishing.PublishingConfigurationExtension.class, org.flywaydb.database.postgresql.TransactionalModel.class}, memberCategories = {MemberCategory.INVOKE_PUBLIC_METHODS, MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS})

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

No branches or pull requests

5 participants