Generated __BeanFactoryRegistrations.java
file contains "too many constants" when building with many beans
#35044
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
theme: aot
An issue related to Ahead-of-time processing
type: bug
A general bug
Milestone
Hi,
I’m running into a problem with a pretty big Spring project (about 18,000 beans). When I build with AOT processing turned on, the build crashes with:
(The generated file is massive—tens of thousands of lines.)
A couple extra details:
AotProcessingApplication__BeanFactoryRegistrations
file is blowing past Java’s class constant pool limit.I searched around and found #33126, which describes a similar situation, but that seemed to be hitting method size limits rather than constant pool limits.
Here’s my setup:
Is there any way to avoid hitting this limit? Can the generated BeanFactory registration file be split up, or is there a recommended workaround for big projects like this?
Right now I'm trying to break up the generated file using a Python script as a Gradle post-task, but it is pretty hacky.
Thanks a lot for any pointers!
The text was updated successfully, but these errors were encountered: