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

XML Configuration is not picked in native image. #7

Open
jogender-dext opened this issue Jun 30, 2023 · 1 comment
Open

XML Configuration is not picked in native image. #7

jogender-dext opened this issue Jun 30, 2023 · 1 comment

Comments

@jogender-dext
Copy link

I created a simple spring boot web application which uses applicationContext.xml to define a bean. The application runs fine on jvm and serves a simple hello user message on rest call. But when I convert this application to spring boot native image it fails to run because it cannot find this bean defined in the applicationContext.xml. I used @ImportResource("applicationContext.xml") to read the context file. The xml is placed in src/main/resources folder. It seems that spring native image cannot read the xml file and completely ignores it.
I have build the image using native build tools with GraalVM distribution.
Can you please help.

@jogender-dext
Copy link
Author

I see that the xml configuration beans in this git project https://github.com/spring-tips/spring-boot-3-aot works fine. I found the problem is with creating and injecting beans with properties via constructor or setter injections. I am using spring version 6.0.10 and spring boot version 3.
Can you please let me know if this a limitation on the spring in current version and if we have an open issue for this. Thanks.

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

1 participant