Question: I have a custom namespace I'm parsing for a Spring project, and I'm having trouble with RuntimeBeanReferences. I have a class MyClass that takes a List. In my beandef file, I have a bean defined of type MyObject named "MyObj".

In my custom namespace parser, I have code that looks like this:

```
RootBeanDefinition myBean = new RootBeanDefinition(MyClass.class);        
ConstructorArgumentValues cav = new ConstructorArgumentValues();
List list = new LinkedList();
list.add(new RuntimeBeanReference("MyObj"));
cav.addIndexedArgumentValue(0, list);

```

However, when I lookup the bean through spring, I get an exception saying it can't convert RuntimeBeanReference to MyObject. Do I need to do something specific to force the reference to be resolved?

thanks,

Jeff

Answer: 
I just found it. I need to use a ManagedList instead of a regular LinkedList. The ManagedList (and ManagedMap) will have references resolved by Spring.
As you found out, you can add list of inner beans in two ways:

Inner beans as references

```
// Create list of bean references
List<RuntimeBeanReference> innerBeans = new ManagedList<RuntimeBeanReference>();
innerBeans.add(new RuntimeBeanReference("innerBean1"));
innerBeans.add(new RuntimeBeanReference("innerBean2"));

// Root bean definition
BeanDefinitionBuilder rootBeanDefinitionBuilder = BeanDefinitionBuilder
        .rootBeanDefinition(RootBean.class)
        .addPropertyValue("innerBeans", innerBeans);

```

Inner beans as inline definitions

```
// Create list of bean references
List<BeanDefinition> innerBeans = new ManagedList<BeanDefinition>();
innerBeans.add(innerBean1Definition);
innerBeans.add(innerBean2Definition);

// Root bean definition
BeanDefinitionBuilder rootBeanDefinitionBuilder = BeanDefinitionBuilder
        .rootBeanDefinition(RootBean.class)
        .addPropertyValue("innerBeans", innerBeans);

```