Spring新手求大神指点++++++++

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SerialTest {

public static void main(String[] args) {

    ApplicationContext sut = new ClassPathXmlApplicationContext("SerialTest.Xml");

    SerialTest1 serialtest1 = (SerialTest1) sut.getBean("Serial1");

    System.out.println(serialtest1);


    错误提示 :Exception in thread "main" java.lang.ClassCastException: com.zzx.collper.io.serial.SerialConnection cannot be cast to com.zzx.SerialTest1
at com.zzx.SerialTest.main(SerialTest.java:15)

错误提示不是很明显了,类型转换错误。你的配置文件中的bean是com.zzx.collper.io.serial.SerialConnection,怎么可以转成com.zzx.SerialTest1呢?