4 Replies Latest reply on May 30, 2008 12:35 PM by David Lloyd

    Anonymous beans

    David Lloyd Master

      In my deployment, I want to be able to programmatically build a BeanMetaData, which represents a bean that should be injected into the property of another bean.

      However I hit a problem that I probably won't be able to explain properly, but here goes:

      First of all, the container is giving an error if the nested bean doesn't have a name. I don't see why it needs a name though, since it's only referenced by the outer bean?

      Second, the nested bean doesn't appear on the deployment, so even if the nested bean has a name, the deployment still fails with a "CONTEXTS MISSING DEPENDENCIES" message.

      Basically I'm trying to programmatically replicate this kind of structure:

      <bean name="TheOuterBean" class="...">
       <property name="prop">
       <bean class="some.inner.Bean"/>
       </property>
      </bean>
      


      Am I making any sense?