zoukankan      html  css  js  c++  java
  • Tomcat启动之异常java.lang.IllegalStateException

    严重: 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:921)
        at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:895)
        at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:841)
        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:5165)
        at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5838)
        at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:221)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:149)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1700)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1690)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)

    情况1.

    链接:https://www.cnblogs.com/lomomiao/p/4269519.html)

    正确写法:

    cxt = new ClassPathXmlApplicationContext("beans.xml");

    productService = (ProductService)cxt.getBean("productTypeServiceBean");
  • 相关阅读:
    使用envoy在k8s中作grpc的负载均衡
    操作系统中锁的原理(转)
    Linux shell利用sed如何批量更改文件名详解(转)
    Http 连接复用
    记一次Redis错误排查经历(redis cluster 节点重启后无限同步问题)
    nginx重启几种方法(转)
    k8s基础知识-1、基础组件
    Eclipse的预设的Include的路径
    转:音频与采样的计算
    转: wireshark过滤语法总结
  • 原文地址:https://www.cnblogs.com/smileblogs/p/9479522.html
Copyright © 2011-2022 走看看