原文:解决springjava.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh'异常

错误写法: cxt new ClassPathXmlApplicationContext productService ProductService cxt.getBean productTypeServiceBean 正确写法: cxt new ClassPathXmlApplicationContext beans.xml productService ProductService cxt.g ...

2015-02-03 11:17 0 5981 推荐指数:

查看详情

BeanFactory not initialized or already closed - call 'refresh' before access

遇到这种错误的时候,看到网上很多人都是建议这么解决BeanFactory没有实例化或者已经关闭了,其实产生错误的原因很简单,在写: ApplicationContext ctx = new ClassPathXmlApplicationContext(); 时,没有指定配置文件 ...

Tue Aug 23 22:17:00 CST 2016 1 4275
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM