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

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,
via Stack Overflow by Unknown author

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

,

Upgrade spring-web and spring-webmvc dependencies. Also upgrade your Java version to Java 8 if using less.

Solutions on the web

via Stack Overflow by PayBash
, 11 months ago
BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the
via Google Groups by Dotun oluyade, 1 year ago
BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
via Stack Overflow by bhcmoney
, 2 years ago
BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
via dolinked.com by Unknown author, 2 years ago
BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
via programering.com by Unknown author, 2 years ago
BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
via javabeat.net by Unknown author, 1 year ago
BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the
at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:172)
at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1066)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1040)
at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:556)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4763)
at org.apache.catalina.core.StandardContext$4.run(StandardContext.java:5472)
at java.lang.Thread.run(Unknown Source)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5481)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:225)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1033)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:774)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1033)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:291)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:727)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:303)

Users with the same issue

Once, 1 month ago
Once, 1 year ago
6 times, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 5 months ago
Samebug visitor profile picture
Unknown user
Once, 7 months ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.