java.lang.ClassCastException: $Proxy12008-04-29 09:36ApplicationContext ac =new FileSystemXmlApplicationContext("E:/workspace/yf/src/spring/applicationContext.xml"); IUserService regService =(IUserService)ac.getBean("userService"); User reg=new User(); reg.setPassword("pwd123 123"); reg.setUsername("uname"); reg.setQuanxian(1); regService.addUser(reg); 这个错误是,使用了实现类,把她(黑色字体)变成接口就可以了啦