Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add AOT and Graal Native support #667

Closed
kartik-kaushik opened this issue Jan 11, 2023 · 9 comments
Closed

Add AOT and Graal Native support #667

kartik-kaushik opened this issue Jan 11, 2023 · 9 comments

Comments

@kartik-kaushik
Copy link

Describe the bug

Vault connection fails to initialize during the Spring Boot 3 AOT phase

Sample
Via the Spring Initializer, create any project with:

spring-boot-starter-parent:3.0.1
spring-cloud-starter-vault-config (spring-cloud-dependencies:2022.0.0 is configured automatically)

the application works normally, but when passing through the AOT phase, the build fails with this error:

Exception in thread "main" java.lang.IllegalStateException: No constructor or factory method candidate found for Root bean: class [org.springframework.vault.client.RestTemplateFactory]; scope=singleton; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodNames=null; destroyMethodNames=null and argument types []

vault config in application.yaml

spring:
config:
import: vault:///app
profiles:
active: dev12
application:
name: app
cloud:
vault:
authentication: APPROLE
fail-fast: false
uri: https://vaultui
app-role:
role-id: db02udb8-a390-0239-980e-11ec746f95ab
secret-id: 8d9nf101-5764-124d-f5e4-ab98fa9ed2c3
generic:
enabled: false

@mp911de
Copy link
Member

mp911de commented Jan 11, 2023

There's no AOT support for Vault yet.

@mp911de mp911de changed the title Vault connection issue with SpringBoot3 AOT mode Add AOT and Graal Native support Jan 11, 2023
@igcherkaev
Copy link

There's no AOT support for Vault yet.

Is it planned to be added? And if yes, when?

@kartik-kaushik
Copy link
Author

@mp911de any tentative date on it. When can we expect it's support

@Abhi-Codes
Copy link

@mp911de Any workaround by adding hints until we get the support for AOT?

@mp911de
Copy link
Member

mp911de commented Jan 27, 2023

We need some infrastructure from Spring Vault, see spring-projects/spring-vault#747

@mp911de mp911de added this to the 4.0.1 milestone Jan 27, 2023
@igcherkaev
Copy link

Thank you @mp911de ! This all looks encouraging!

mp911de added a commit that referenced this issue Jan 31, 2023
Align constant names.

See gh-667
spencergibb pushed a commit that referenced this issue Sep 14, 2023
…when transferring instances from the Config Data API.

Closes gh-667
spencergibb pushed a commit that referenced this issue Sep 14, 2023
Align constant names.

See gh-667
@raj-saxena
Copy link

Hi @mp911de, I see that this issue was closed almost and year back and it has been a while since other commits referencing this issue. Does spring-cloud-vault support AOT and Graal Native now? If yes, can you please point me to the docs I couldn't find it here https://cloud.spring.io/spring-cloud-vault/reference/html/?

@mp911de
Copy link
Member

mp911de commented Feb 7, 2024

What kind of documentation are you looking for? There isn't anything that you could configure in regard to AOT. For a general Spring application using Spring Cloud Vault, you just compile a native image and you're good to go.

@raj-saxena
Copy link

You are right @mp911de. I tried it on a quick project - https://github.com/raj-saxena/test-vault-with-graal/tree/main/src/main/java/com/example/testgraal and it worked as expected.

Thanks for the reply!

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

5 participants