java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' befo
程序员文章站
2024-02-22 11:55:10
...
ssm+tomcat搭建过程启动报错(2)
java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
严重: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:170)
at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1033)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1009)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:961)
at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:583)
at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:116)
很明显bean初始化失败了,IDE自动生成的配置文件有问题,删掉后手动创建一个。
WEB-INF/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"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
</beans>
重启成功发布!
知识点:
ContextLoaderListener 的父类ContextLoader 有说明默认路径
default location (with XmlWebApplicationContext: "/WEB-INF/applicationContext.xml")
下一篇: nginx配置
推荐阅读
-
java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' befo
-
BeanFactory not initialized or already closed - call ‘refresh‘ before accessing beans via the Applic
-
BeanFactory not initialized or already closed - call 'refresh' before accessing beans解决
-
使用Spring出现的错误: BeanFactory not initialized or already closed - call 'refresh' before accessin
-
java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' befo
-
java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh'