ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext(new String[] {
"springexample-creditaccount.xml"
});
异常: class path resource [springexample-creditaccount.xml] cannot be opened because it does not exist
改为:
ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext(new String[] {
"spring/springexample-creditaccount.xml"
});
运行正常。
看:Chapter 12. Object Relational Mapping (ORM) data access
http://static.springframework.org/spring/docs/2.5.x/reference/orm.html