title: Bean collection Spring: ConversionNotSupportedException
body: <p>I'm new in Spring and I'm try to create a simple quick start application.
  My application is composed by three java classes, the pom.xml file and another xml file:</p>
  
  <p>Produttore.java:</p>
  
  <pre><code>package com.mkyong.core;
  
  import org.springframework.stereotype.Component;
  
  @Component
  public class Produttore {
      private int iD;
      private String ruolo;
  
  
      public int getiD() {
          return iD;
      }
      public void setiD(int iD) {
          this.iD = iD;
      }
      public String getRuolo() {
          return ruolo;
      }
      public void setRuolo(String ruolo) {
          this.ruolo = ruolo;
      }
  
  
      @Override
      public String toString(){
          return "Produttore " + iD + ", ruolo " + ruolo;
      }
  
  
  }
  </code></pre>
  
  <p>Team.java:</p>
  
  <pre><code>package com.mkyong.core;
  
  import java.util.List;
  
  import org.springframework.stereotype.Component;
  
  @Component
  public class Team {
  
      private Produttore Leader;
      private List&lt;Produttore&gt; membri;
  
  
      public Produttore getLeader() {
          return Leader;
      }
      public void setLeader(Produttore leader) {
          Leader = leader;
      }
      public List&lt;Produttore&gt; getMembri() {
          return membri;
      }
  
      public void setMembri(List&lt;Produttore&gt; membri) {
              this.membri = membri;
      }
  
      public void addMembri(Produttore p){
          this.membri.add(p);
      }
  
      @Override
      public String toString(){
          return "Trainer " + Leader + " numero membri: " + membri.size();
      }
  }
  </code></pre>
  
  <p>test1.java:</p>
  
  <pre><code>package com.mkyong.core;
  
  import org.springframework.context.ApplicationContext;
  import org.springframework.context.support.ClassPathXmlApplicationContext;
  
  public class test1 {
      public static void main(String[] args){
          ApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"Test1xml.xml"});
          Team ris=(Team)context.getBean("TeamBean");
          System.out.println(ris);
      }
  }
  </code></pre>
  
  <p>Test1xml.xml:</p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xmlns:util="http://www.springframework.org/schema/util"
      xsi:schemaLocation="http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
      http://www.springframework.org/schema/util
      http://www.springframework.org/schema/util/spring-util-2.5.xsd"&gt;
  
      &lt;bean id="ProduttoreBean" class="com.mkyong.core.Produttore"&gt;
                  &lt;property name="iD" value="1234"/&gt;
                  &lt;property name="ruolo" value="Trainer"/&gt;
      &lt;/bean&gt;
  
      &lt;bean id="TeamBean" class="com.mkyong.core.Team"&gt;
          &lt;property name="Leader"&gt;
              &lt;bean class="com.mkyong.core.Produttore"&gt;
              &lt;property name="iD" value="1111"&gt;&lt;/property&gt;
              &lt;property name="ruolo" value="Trainer"/&gt;
              &lt;/bean&gt;
          &lt;/property&gt;
          &lt;property name="membri"&gt;
              &lt;util:list list-class="java.util.ArrayList"&gt;
                  &lt;value&gt;0&lt;/value&gt;
                      &lt;ref bean="ProduttoreBean2" /&gt;
              &lt;/util:list&gt;
          &lt;/property&gt; 
      &lt;/bean&gt;
  
      &lt;bean id="ProduttoreBean2" class="com.mkyong.core.Produttore"&gt;
                      &lt;property name="iD" value="1112" /&gt;
                      &lt;property name="ruolo" value="Junior"/&gt;
      &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>pom.xml:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
      http://maven.apache.org/maven-v4_0_0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.mkyong.core&lt;/groupId&gt;
      &lt;artifactId&gt;Spring3Example&lt;/artifactId&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;Spring3Example&lt;/name&gt;
      &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
      &lt;properties&gt;
          &lt;spring.version&gt;3.0.5.RELEASE&lt;/spring.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
  
          &lt;!-- Spring 3 dependencies --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
      &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>I don't know why, but when I try to lunch the application it fails. I post the error:</p>
  
  <pre><code>Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'TeamBean' defined in class path resource [Test1xml.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.ArrayList' to required type 'java.util.List' for property 'membri'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [com.mkyong.core.Produttore] for property 'membri[0]': no matching editors or conversion strategy found
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
      at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:139)
      at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:93)
      at com.mkyong.core.test1.main(test1.java:8)
  Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.ArrayList' to required type 'java.util.List' for property 'membri'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [com.mkyong.core.Produttore] for property 'membri[0]': no matching editors or conversion strategy found
      at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:462)
      at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:499)
      at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:493)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1371)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1330)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
      ... 11 more
  Caused by: java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [com.mkyong.core.Produttore] for property 'membri[0]': no matching editors or conversion strategy found
      at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231)
      at org.springframework.beans.TypeConverterDelegate.convertToTypedCollection(TypeConverterDelegate.java:520)
      at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:173)
      at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:447)
      ... 17 more
  </code></pre>
  
  <p>Could someone help me? Thanks a lot</p>