BeanFactory not initialized or already closed - call 'refresh' before

后端 未结 10 1561
無奈伤痛
無奈伤痛 2020-12-10 01:23

here is my error:

I am getting this error , can any one help me on this.

> SEVERE: Exception sending context initialized event to listener
> i         


        
相关标签:
10条回答
  • 2020-12-10 01:25

    This problem can be caused also by jvm version used to compile the project and the jvm supported by the servlet container. Try to Fix the project build path. For example if you deploy on tomcat 9, use jvm 1.8.0 or lower.

    0 讨论(0)
  • 2020-12-10 01:27

    I came across this issue twice once in upgrading to 3.2.18 from 3.2.1 and 4.3.5 from 3.2.8. In both cases, this error is because of different version of spring modules

    0 讨论(0)
  • 2020-12-10 01:29

    I had the same error and I had not made any changes to the application config or the web.xml. Multiple tries to revert back some minor changes to code was not clearing the exceptions. Finally it worked after restarting STS.

    0 讨论(0)
  • 2020-12-10 01:30

    In the spring framework inside the springframework initialization Repository or controller annotation, the same class name can only exist a default instance, you can set the value name

    0 讨论(0)
  • 2020-12-10 01:37

    I had this issue until I removed the project in question from the server's deployments (in JBoss Dev Studio, right-click the server and "Remove" the project in the Servers view), then did the following:

    1. Restarted the JBoss EAP 6.1 server without any projects deployed.
    2. Once the server had started, I then added the project in question to the server.

    After this, just restart the server (in debug or run mode) by selecting the server, NOT the project itself.

    This seemed to flush any previous settings/states/memory/whatever that was causing the issue, and I no longer got the error.

    0 讨论(0)
  • 2020-12-10 01:38

    The issue here is that the version of spring-web that you're using (3.1.1-RELEASE) is not compatible with the version of spring-beans that you're using (3.0.2-RELEASE). At the top of the stack you can see the NoSuchMethodError which in turn triggers the BeanFactory not initialized... exception.

    The NoSuchMethodError is caused because the method invocation XmlWebApplicationContext.loadBeanDefinitions() in spring-web is trying to call XmlBeanDefinitionReader.setEnvironment() in spring-beans which doesn't exist in 3.0.2-RELEASE. It does however exist in 3.1.1-RELEASE - as setEnvironment is inherited from the parent AbstractBeanDefinitionReader.

    To resolve, you'd probably be best to upgrade the spring-beans jar to 3.1.1-RELEASE. The version for this jar appears to be parameterized in your pom.xml and is controlled by the property org.springframework.version further down in the file.

    0 讨论(0)
提交回复
热议问题