0

I have two beans like this:

<alias name="defaultProblematicBean" alias="problematicBean" />
<bean id="defaultProblematicBean"
    class="com.application.ProblematicClass">
    <property name="strategies" ref="problematicStrategiesList" />
</bean>

<alias name="defaultProblematicStrategiesList" alias="problematicStrategiesList" />
<util:list id="defaultProblematicStrategiesList">
    <bean id="bean1" parent="defaultProblematicBean"
        class="com.application.ProblematicClass$ProblematicInnerClass1" />
    <bean id="bean2" parent="defaultProblematicBean"
        class="com.application.ProblematicClass$ProblematicInnerClass2" />
</util:list>

ProblematicInnerClass1 and ProblematicInnerClass2 are static inner classes inside of ProblematicClass that extend from ProblematicClass.

When I try to start the context, spring throws the following error:

Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'jdk.proxy4.$Proxy363 implementing java.util.List' to required type 'java.util.List' for property 'strategies'; nested exception is java.lang.IllegalStateException: Singleton instance not initialized yet

I am trying to understand why spring is not capable of mapping a java.util.List. Why does it generate a proxy?

I have been debugging deep inside of Spring to no avail. This problem started happening with spring 5.3.29

Any help will be greatly appreciated!

user1532449
  • 322
  • 4
  • 14

1 Answers1

0

This issue started to happen with 5.3.29, the bug below explains why: https://github.com/spring-projects/spring-framework/issues/31138

user1532449
  • 322
  • 4
  • 14