spring-framework icon indicating copy to clipboard operation
spring-framework copied to clipboard

Native image (graalvm) does not work with circular dependency

Open abugozeh opened this issue 1 year ago • 3 comments

When I add this propriety spring.main.allow-circular-references=true in local it works fine but when I run the project using graalvm it doesn't work with I tried also @Lazy it does not work with circular dependency issues

Java version: 20

spring-boot version : 3.2.6

abugozeh avatar Jun 27 '24 11:06 abugozeh

Please share a sample of what you mean with instructions to reproduce. You can attach a zip to this issue or push the code to a GitHub repository.

snicoll avatar Jun 27 '24 16:06 snicoll

@snicoll, sorry I can't provide the code, but the issue is that I upgraded from Spring 2 to Spring 3, and then a circular dependency occurred:

A --> B --> C --> A

I tried to add the following to application.properties:

spring.main.allow-circular-references=true Locally, without using GraalVM native image, it works fine. However, when I use the GraalVM native image, the circular dependency issue still appears.

abugozeh avatar Jun 29 '24 12:06 abugozeh

I am not asking you to provide your application but a small sample that replicates the behaviour. We can’t really help if we have to guess your configuration arrangement.

snicoll avatar Jun 29 '24 14:06 snicoll

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-projects-issues avatar Jul 06 '24 14:07 spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

spring-projects-issues avatar Jul 13 '24 14:07 spring-projects-issues