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
本文解决了一个关于Spring框架中配置文件路径的问题,原本路径无法找到配置文件导致异常,通过修改路径为'spring/springexample-creditaccount.xml'后,问题得到解决。
1210

被折叠的 条评论
为什么被折叠?



