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

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 user569825

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

Solutions on the web

via spring.io by Unknown author, 1 year ago
BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
via Spring JIRA by Grant Gochnauer, 1 year ago
BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
via Spring JIRA by Grant Gochnauer, 1 year ago
BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
via spring.io by Unknown author, 1 year ago
BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
via Stack Overflow by Hariom Yadav
, 1 month ago
BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
via baidu.com 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 ApplicationContext
at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:171)
at org.springframework.web.context.ContextLoader.loadParentContext(ContextLoader.java:343)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:188)
at com.ibm.ws.wswebcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:653)

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.