java.lang.IllegalStateException

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

Samebug tips2

Execute mvn dependency:tree from your project's root directory.


rprp

The application is unable to connect to the database. It could be resolved by configuring access privileges on the database side.


rprp

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web478

  • via Unknown by Samuel Ngoda,
  • via Unknown by Samuel Ngoda,
  • via Unknown by Samuel Ngoda,
  • Stack trace

    • 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:172) at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1071) at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1045) at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:993) at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:548) at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:142) at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5124) at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5786) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1095) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1957) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    155 more bugmates