java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext

Stack Overflow | Jhonatan Souza | 8 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Context initialization failed java.lang.IllegalArgumentException

    Stack Overflow | 8 months ago | Jhonatan Souza
    java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
  2. 0

    Tomcat 7 many Exceptions

    Stack Overflow | 5 years ago | user902691
    java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
  3. 0

    BeanFactory not initialized or already closed spring security

    Stack Overflow | 4 years ago | user1259670
    java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Spring Autowired in Controller not working

    Stack Overflow | 3 years ago | Ani
    java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
  6. 0

    Setup Apache CFX in Eclipse

    Stack Overflow | 3 years ago | Mr ....
    java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext

  1. serious2monkeys 1 times, last 10 months ago
  2. esaar 2 times, last 10 months ago
  3. linxiaolong 1 times, last 2 weeks ago
  4. Andreas Häber 3 times, last 1 month ago
  5. kjhdofjosvs 2 times, last 6 months ago
4 more registered users
91 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.IllegalStateException

    BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext

    at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory()
  2. Spring Context
    AbstractApplicationContext.close
    1. org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:170)
    2. org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:908)
    3. org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:884)
    4. org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:836)
    4 frames
  3. Spring
    ContextLoaderListener.contextDestroyed
    1. org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:579)
    2. org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:115)
    2 frames
  4. Glassfish Core
    ContainerBase$StartChild.call
    1. org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4858)
    2. org.apache.catalina.core.StandardContext.__stop(StandardContext.java:5474)
    3. org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java)
    4. org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224)
    5. org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:159)
    6. org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
    7. org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
    7 frames
  5. Java RT
    Thread.run
    1. java.util.concurrent.FutureTask.run(Unknown Source)
    2. java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    3. java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    4. java.lang.Thread.run(Unknown Source)
    4 frames