BeanFactory not initialized or already closed
来源:互联网 发布:大数据量 数据库 编辑:程序博客网 时间:2024/06/07 10:40
BeanFactory not initialized or already closed - call ‘refresh’ before accessing beans via the ApplicationContext
jboss启动报错,百度结果如下:
错误:java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext错误原因:BeanFactory没有实例化或者已经关闭。原因很简单:ApplicationContext ctx = new ClassPathXmlApplicationContext();Spring实例化BeanFactory的时候是默认到classPath下面查找名为applicationContext.xml的文件。这正是这个错误的原因,修改为:ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");如果这样的话就不会出现这样的错误了。applicationContext.xml,可以是自己命名的xml。
然后并不符合我本地的情况,检查代码发现出现了相同的注解名称(我是复制过来的service然后改的,忽略了service的注解名忘记改了)
@Service("loginservice")public class UserService {}
将loginservice改成userservice,ok
注意养成良好的编码习惯,否则总是会出现一些莫名其妙的报错信息,然后照着百度又会改的面目全非,哈哈
1 0
- BeanFactory not initialized or already closed
- BeanFactory not initialized or already closed
- BeanFactory not initialized or already closed
- BeanFactory not initialized or already closed
- BeanFactory not initialized or already closed
- BeanFactory not initialized or already closed
- 问题BeanFactory not initialized or already closed
- BeanFactory not initialized or already closed
- BeanFactory not initialized or already closed
- java.lang.IllegalStateException: BeanFactory not initialized or already closed
- BeanFactory not initialized or already closed - call 'refresh' before access
- idea报错:BeanFactory not initialized or already closed
- java.lang.IllegalStateException: BeanFactory not initialized or already closed
- java.lang.IllegalStateException: BeanFactory not initialized or already closed
- java.lang.IllegalStateException: BeanFactory not initialized or already closed
- tomacat 启动时报错 : BeanFactory not initialized or already closed
- BeanFactory not initialized or already closed - call 'refresh' before accessing beans解决办法
- BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the Applic
- windows10+eclipse neon+hadoop2.6.4(伪分布式)远程连接虚拟机环境搭建
- 一个想法(续二):换个角度思考如何解决IT企业招聘难的问题!
- js与android原生的互调
- 快速排序
- 数据库新技术3
- BeanFactory not initialized or already closed
- Android 中的Handler原理
- Java开发中的23种设计模式详解及代码和图解
- BZOJ 2957 分块
- MySQL用户名和密码都正确却无法登陆的问题
- android 媒体播放器之播放音乐
- android 媒体播放器之播放音乐
- Android Service基础
- IL2Cpp深坑之WeakReference