使用tomcat插件报错问题
2018-01-19 21:49
253 查看
今天,在搭建一个商城项目的过程中,遇到了这么一个问题java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
我是在service层启动的tomcat插件,由于习惯性的在web.xml文件中初始化spring容器,如下
<!-- 初始化spring容器 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/applicationContext-*.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
导致在tomcat启动的时候在classpath路径下找不到applicationContext_*.xml文件,(因为我还没有applicationContext_*.xml文件)导致报错。这算是一个很低级的错误,对于搭建环境来说,还是每一步用到的时候再增加,一步一步去搭建。对于高手来说,可以略过^^
我是在service层启动的tomcat插件,由于习惯性的在web.xml文件中初始化spring容器,如下
<!-- 初始化spring容器 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/applicationContext-*.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
导致在tomcat启动的时候在classpath路径下找不到applicationContext_*.xml文件,(因为我还没有applicationContext_*.xml文件)导致报错。这算是一个很低级的错误,对于搭建环境来说,还是每一步用到的时候再增加,一步一步去搭建。对于高手来说,可以略过^^
相关文章推荐
- IDEA 使用Tomcat插件进行调试web程序时,1099端口被占用问题
- maven使用tomcat插件自动化部署——java source文件夹路径问题(二)
- eclipse中tomcat插件的使用问题
- 使用maven的tomcat插件启动时报错问题
- IDEA使用maven中tomcat插件启动项目乱码问题
- 使用maven的tomcat插件启动时报错问题
- maven 使用tomcat 插件,项目部署时访问路径问题
- 我在Eclipse中使用Tomcat插件的遇到的一些问题
- 使用maven插件Tomcat7 启动成功但是404的问题
- 我在Eclipse中使用Tomcat插件的遇到的一些问题
- 解决Eclipse最新版无法使用Tomcat插件问题
- 关于使用maven tomcat插件运行项目的问题
- 【转载】解决使用tomcat7-maven-plugin插件时 “Application already exists at path”的问题
- tomcat5.5 使用tomcatplugin 插件问题
- 005商城项目:ssm框架的整合成功之后的问题:使用maven的tomcat插件时的debug
- 我在Eclipse中使用Tomcat插件的遇到的一些问题
- 我在Eclipse中使用Tomcat插件的遇到的一些问题
- 解决使用tomcat7-maven-plugin插件时 “Application already exists at path”的问题
- maven使用tomcat插件自动化部署——编码问题
- 使用tomcat maven插件过程中的一些问题