spring的这个工具有个大坑:
@Test public void test2() { List<A> list = new ArrayList<>(); //com.sentinel.demo.kk.A; list.add(new A("kk.A")); User user = new User(); user.setList(list); User2 user2 = new User2(); BeanUtils.copyProperties(user,user2); //执行完这一步不会报错,并且user2的List<A>有数据 System.out.println(user2.getList().get(0).getClass()); //执行完这里就挂了 }