No bean named 'springSessionRepositoryFilter' is defined

Since the first configuration is used, it will look for applicationContext.xml, but there is no applicationContext.xml in the project, so this error is reported
 
solve:
Let's remove the one in web.xml
<listener>
  <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>


 

The way that web.xml loads the spring configuration file is mainly differentiated according to the name of the configuration file and the location where it is stored. At present, there are mainly two ways.

1. If the name of the spring configuration file is applicationContext.xml and it is stored in the WEB-INF/ directory, then you only need to add the following code to web.xml

<listener>
  <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

The listener will automatically scan the applicationContext.xrnl file under WEB-INF/, which is mostly used when there is only one configuration file.
You can also use this special Servlet of Spring's ContextLoaderServlet, the implementation code is as follows

<servlet>
  <servlet-name>context</servlet-name>
  <servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-name>
  <load-on-startup>1(比较小的数字就可以)</load-on-startup>
</servlet>

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326612202&siteId=291194637