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

Process AOT - Error with "composite" profile in Spring Cloud Config Server generating Native Image #2395

Closed
dani-house opened this issue Mar 26, 2024 · 3 comments · Fixed by #2412
Assignees
Labels
Milestone

Comments

@dani-house
Copy link

dani-house commented Mar 26, 2024

Hi,

It's not possible to generate a native image with the composite profile. Executing the process-aot step, we get the error:

Default code generation is not supported for bean definitions declaring an instance supplier callback: Root bean: class [org.springframework.cloud.config.server.support.**EnvironmentRepositoryProperties**]; scope=singleton; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodNames=null; destroyMethodNames=null

application.yaml sample:

spring:
  application:
    name: config-server

  profiles:
    active: composite

  cloud:
    refresh:
      enabled: false

    config:
      server:
        composite:
          - type: git
            uri: https://dev.azure.com/xxxx/_git/repo1
            search-paths: '{application}'
            force-pull: true
            refresh-rate: 5
            try-master-branch: false
            default-label: main
            clone-on-start: true
          - type: git
            uri: https://dev.azure.com/xxxx/_git/repo2
            search-paths: '{application}'
            force-pull: true
            refresh-rate: 5
            try-master-branch: false
            default-label: main
            clone-on-start: true
@ryanjbaxter
Copy link
Contributor

@dani-house
Copy link
Author

Config server compiles and it runs correctly with a simple git configuration, like this:

spring:
  cloud:
    config:
      server:
        git:
          uri: https://dev.azure.com/xxx/_git/repo1
          password: "xxxxx"
          username: "xxxxx"

Compilation error occurs when configuring "composite" profile.

@OlgaMaciaszek
Copy link
Contributor

OlgaMaciaszek commented Apr 23, 2024

This is, unfortunately, a known issue in Framework: spring-cloud/spring-cloud-function#1074; we'll probably need to rewrite it to avoid using the supplier or manually create the AotContribution. Will look further into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants