私は次のような内部クラスを持つクラスを持っています:
package myPackage;
public class A {
private B b;
public void setB(B b) { this.b = b; }
public B getB() { return this.b; }
public class B {
}
}
そして、私は次のように私の春の設定を持っています:
<bean id="a" class="myPackage.A" autowire="byName" scope="prototype">
<property name="b">
<bean class="myPackage.A$B" name="b" autowire="byName" scope="prototype">
<constructor-arg ref="a"/>
</bean>
</property>
</bean>
しかし、私はこのエラーに直面しています:
org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'a': Requested bean is currently in creation: Is there an unresolvable circular reference?
もちろん、私が循環参照を持っていることは明らかですが、どうすれば自分の内部クラスに Spring Bean を持たせることができるでしょうか?