1、报错情况
Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type ‘java.util.ArrayList’ to required type ‘java.util.List’ for property ‘students’; nested exception is java.lang.IllegalStateException: Cannot convert value of type ‘java.util.ArrayList’ to required type 'com.test02.di.Student’ for property ‘students[0]’: no matching editors or conversion strategy found
2、场景
进行Sptring框架学习与练习时,报错。
xml文件:
<?xml version="1.0" encoding="UTF-8"?>
<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.xsd http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util.xsd">
<bean id="s1" class="com.test02.di.Student">
<property name="id" value="451"><