Solve the problem of error when Maven starts the spring project

First question

The main reason is javax The servlet API treats the spring container as a servlet container at runtime, and a type conversion error occurs.

resolvent:

In POM Modify javax. XML file The scope of servlet API is provided

Second question:

In SSM project, since mapper mapping files and other configuration files need to be identified in Maven project, the following configuration will be added to allow these static files to pass,

However, the above configuration modifies the default resource directory, so that all files in Src / main / resources cannot be scanned, and other files in the resources directory cannot be scanned. Therefore, the default resources directory configuration needs to be added:

The above article to solve the problem of error reporting when Maven starts the spring project is all the content shared by Xiaobian. I hope it can give you a reference and support more programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>