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

前端 未结 7 1344
太阳男子
太阳男子 2021-01-03 23:09

I\'m trying to add spring security to a regular JSF application. After repeated tries and I\'m failing with the following error on tomcat bring-up.

Here is the entir

7条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-03 23:54

    I had the same problem, and it turned out there's an issue with the maven spring dependency chain. Dependency org.springframework spring-context was imported with version 3.0.5, whereas the overall spring version I was using was 3.2.2. Explicitly adding the dependency in my pom.xml solved it.

    I detected the issue by using the -verbose:class jvm argument when running the server, and checking the jars classes in the XmlWebApplicationContext inheritance tree were loaded from.

提交回复
热议问题