java.lang.IllegalStateException: BeanFactory
2015-08-27 21:55
309 查看
java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
原因:WEB-INFO目录下没有创建applicationContext.xml
创建:applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"
default-lazy-init="true">
<context:annotation-config />
<!-- Activates scanning of @Repository and @Service -->
<context:component-scan base-package="net.ren" />
<!-- Add new Managers here -->
</beans>
原因:WEB-INFO目录下没有创建applicationContext.xml
创建:applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"
default-lazy-init="true">
<context:annotation-config />
<!-- Activates scanning of @Repository and @Service -->
<context:component-scan base-package="net.ren" />
<!-- Add new Managers here -->
</beans>
相关文章推荐
- javaweb之web入门基础
- javaweb中静态文件的常用处理方法汇总
- JavaWeb中struts2实现文件上传下载功能实例解析
- JavaWeb工程中集成YMP框架快速上手
- JavaWeb实现文件上传下载功能实例解析
- 用过滤器处理乱码问题 javaweb
- .WEB_002dINF.jsp.login_jsp._jspInit,java.lang.IllegalStateException: dbType not support : null
- applicationContext.xml 是出现 Referenced file contains errors
- JAVA EE 学习路线
- Dom4j解析XML文档 —— 增删改查
- Spring BeanFactory 和ApplicationContext接口
- BeanFactory中Bean的生命周期
- javaWeb Servlet的helloworld
- javaWeb jstl的基础使用
- eclipse 添加 aptana插件
- javaWeb jstl的基本库的定义, 迭代循环, 条件判断
- 解决JavaWeb项目跨域
- strut1文件上传发现的问题
- Tomcat 基础
- Tomcat 虚拟目录配置