oracle / graalvm-reachability-metadata

Repository which contains community-driven collection of GraalVM reachability metadata for open-source libraries.
Creative Commons Zero v1.0 Universal
366 stars 89 forks source link

Add support for `org.liquibase:liquibase-core:4.24.0` #431

Open snicoll opened 10 months ago

snicoll commented 10 months ago

Liquibase 4.24.0 requires an additional hint due to the use of ChangeLogHistoryServiceFactory that is created via reflection.

This has been reported in the Spring Boot project: https://github.com/spring-projects/spring-boot/issues/38941

Here is a sample that reproduces the issue if you comment @ImportRuntimeHints in the main application: https://github.com/snicoll-scratches/sb-38941

The missing reflect-config.json entry is as follows:

{
  "name": "liquibase.changelog.ChangeLogHistoryServiceFactory",
  "methods": [
    {
      "name": "<init>",
      "parameterTypes": [ ]
    }
  ]
}
bmihnea commented 8 months ago

Also the liquibase.ui.LoggerUIService needs to be added. I managed to get it to work with the following reflect-config.json

[
  {
    "name": "liquibase.ui.LoggerUIService",
    "condition": {
      "typeReachable": "liquibase.ui.LoggerUIService"
    },
    "methods": [
      {
        "name": "<init>",
        "parameterTypes": [
        ]
      }
    ]
  },
  {
    "name": "liquibase.changelog.ChangeLogHistoryServiceFactory",
    "condition": {
      "typeReachable": "liquibase.changelog.ChangeLogHistoryServiceFactory"
    },
    "methods": [
      {
        "name": "<init>",
        "parameterTypes": [
        ]
      }
    ]
  },
  {
    "name": "liquibase.changelog.StandardChangeLogHistoryService",
    "condition": {
      "typeReachable": "liquibase.changelog.ChangeLogHistoryServiceFactory"
    },
    "methods": [
      {
        "name": "<init>",
        "parameterTypes": [
        ]
      }
    ]
  }
]
dnestoro commented 8 months ago

Hey @snicoll @bmihnea , thanks for this request. It would be very nice if you can provide a pull request that adds missing metadata for this library. Here is our guide, how to contribute to metadata repository. If you have any questions, please feel free to ask.

filiphr commented 8 months ago

I believe that this issue has been covered by PR #385 already. When I upgrade the native maven plugin to use version 0.10.1, then the metadata for liquibase 4.23.0 is used and our Liquibase tests are passing. Using 0.9.27 they are failing (you can see this in https://github.com/flowable/flowable-engine/actions/runs/8363935080/job/22898067207)

wilkinsona commented 8 months ago

385 didn't cover LoggerUIService that @bmihnea mentions above. Without it, I see failures with Liquibase 4.26.0:

Caused by: liquibase.exception.UnexpectedLiquibaseException: java.lang.NoSuchMethodException: liquibase.ui.LoggerUIService.<init>() 
    at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:304) ~[liquibase:na]    
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1833) ~[liquibase:6.1.6-SNAPSHOT] 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1782) ~[liquibase:6.1.6-SNAPSHOT]    
    ... 17 common frames omitted    
Caused by: java.lang.NoSuchMethodException: liquibase.ui.LoggerUIService.<init>()   
    at java.base@17.0.8/java.lang.Class.getConstructor0(DynamicHub.java:3585) ~[liquibase:na]   
    at java.base@17.0.8/java.lang.Class.getDeclaredConstructor(DynamicHub.java:2754) ~[liquibase:na]    
    at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:287) ~[liquibase:na]    
    ... 19 common frames omitted

Perhaps this issue could be repurposed to tackle 4.26.0?

filiphr commented 8 months ago

Good point @wilkinsona. Thanks for spotting that

alvarosanchez commented 7 months ago

We also discovered that this is needed too:

{
  "name":"liquibase.parser.SqlParserFactory",
  "methods":[{"name":"<init>","parameterTypes":[] }, {"name":"<init>","parameterTypes":["liquibase.Scope"] }]
}
radovanradic commented 5 months ago

Need to add one more entry for 4.2.8

{
    "name": "liquibase.changelog.visitor.ValidatingVisitorGeneratorFactory",
    "methods": [
      {
        "name": "<init>",
        "parameterTypes": [

        ]
      },
      {
        "name": "<init>",
        "parameterTypes": [
          "liquibase.Scope"
        ]
      }
    ]
  }