[Solved] javax.servlet.ServletException: Servlet[springmvc] Servlet.init()

1. There are many cases of this exception. First of all,
when configuring sqlsessionfactorybean, you should not pay attention to the problem (see the figure)

the same as above, when configuring other places, you also use ref as value. For example,

PS: combined with the above, it can discharge itself. Pay attention to whether it is this problem

2. Problems that we didn’t pay attention to when configuring servlets with web.xml

as shown in the figure: after the integration, the configuration file should not be MVC, but should be all. Generally, when creating a configuration file, there will be a prompt in the upper right corner, which may cause this kind of problem if you don’t pay attention to it. Generally, my solution is to use the import tag (as shown in the figure)

import all the configuration files into a general file
and then import the web and XML into the general file as follows

PS: there are some special reasons, which vary from person to person. Hope someone can add!

Read More: