BeanFactory not initialized or already closed - call 'refresh' before accessing beans

BeanFactory没有实例化或者已经关闭了,其实产生错误的原因很简单,没有正确找到Spring配置文件。

Spring实例化BeanFactory的时候是默认到classPath下面查找名为applicationContext.xml的文件的,但是呢,没有找到,所以出现了这个错误。

posted @ 2015-01-19 16:44  CodeWolf  阅读(2078)  评论(0编辑  收藏  举报