eclipse:Neon
tomcat:9
When learning SpringMVC, eclipse creates dynamic web projects
Create config (source folder) and src peers
Create the configuration file springmvc.xml in the config directory and load it in web.xml
Project run as-》run configuration
Error report:
Type Exception Report
Message Servlet.init() for servlet [springmvc] threw exception
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [sprigmvc.xml]; nested exception is java.io.FileNotFoundException: class path resource [sprigmvc.xml] cannot be opened because it does not exist
run as -》run configuration
Configure classpath, add project
still report that springmvc.xml in classpath cannot be found
Caused by: java.io.FileNotFoundException : class path resource [sprigmvc.xml] cannot be opened because it does not exist
The path to springmvc.xml is wrong, resulting in the xml file being unable to be found and reading failing
Solved because the environment variable classpath is not set
.;%JAVA_HOME%libdt.jar;%JAVA_HOME%libtools.jar