• 【Error listenerStart】 Error listenerStart Context [] startup failed due to previous errors


    发给

    报错信息

    八月 12, 2015 11:58:19 上午 org.apache.coyote.AbstractProtocol start
    信息: Starting ProtocolHandler ["http-apr-8080"]
    八月 12, 2015 11:58:19 上午 org.apache.coyote.AbstractProtocol start
    信息: Starting ProtocolHandler ["ajp-apr-8009"]
    八月 12, 2015 11:58:19 上午 org.apache.catalina.startup.Catalina start
    信息: Server startup in 672 ms
    八月 12, 2015 11:58:21 上午 org.apache.catalina.core.StandardContext startInternal
    严重: Error listenerStart
    八月 12, 2015 11:58:21 上午 org.apache.catalina.core.StandardContext startInternal
    严重: Context [] startup failed due to previous errors
    八月 12, 2015 12:37:28 下午 org.apache.catalina.core.ApplicationContext log
    信息: Closing Spring root WebApplicationContext
    八月 12, 2015 12:37:28 下午 org.apache.catalina.core.StandardContext listenerStop
    严重: 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:908)
        at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:884)
        at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:836)
        at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:579)
        at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:115)
        at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4927)
        at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5573)

    配置文件位置:

    加粗部分 使用

    init-param> 会造成这样的问题
    <web-app version="2.4"
        xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
        http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    
        <display-name>Spring MVC Application</display-name>
        <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath*:applicationContext.xml</param-value>
        </context-param>
        <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>
        <!-- 配置缓存清除监听器,负责处理由 JavaBean Introspector 功能而引起的缓存泄露 -->
        <listener>
            <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
        </listener>
    
    
        <servlet>
            <servlet-name>mvc-dispatcher</servlet-name>
            <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
            <!--<init-param>
                <param-name>contextConfigLocation</param-name>
                <param-value>classpath*:applicationContext.xml</param-value>
            </init-param>-->
            <load-on-startup>1</load-on-startup>
        </servlet>
    
        <servlet-mapping>
            <servlet-name>mvc-dispatcher</servlet-name>
            <url-pattern>/</url-pattern>
        </servlet-mapping>
    
    
    
    
        <!-- 解决中文乱码 -->
        <filter>
            <filter-name>SpringCharacterEncodingFilter</filter-name>
            <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
            <init-param>
                <param-name>encoding</param-name>
                <param-value>UTF-8</param-value>
            </init-param>
        </filter>
        <filter-mapping>
            <filter-name>SpringCharacterEncodingFilter</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>
        <welcome-file-list>
            <welcome-file>404.html</welcome-file>
            <welcome-file>/index.jsp</welcome-file>
        </welcome-file-list>
    </web-app>
  • 相关阅读:
    git 更新代码
    jmeter 线程组之间传递动态变化的变量值
    MYSQL 使用存储过程批量更新表数据
    linux查看日志中特定字符串以及前后信息内容命令
    导出表结构 字段说明
    转 awk统计nginx每天访问最高的接口
    MySQL 同一字段匹配多个值
    Can't connect to local MySQL server through socket '/opt/lampp/var/mysql/mysql.sock' (2)
    转 Xshell ssh长时间连接不掉线设置
    Vs.net 常用命令行
  • 原文地址:https://www.cnblogs.com/viewcozy/p/4723924.html
Copyright © 2020-2023  润新知