Home  >  Q&A  >  body text

java - eclipse run on server, classpath, not find springmvc.xml

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

PHP中文网PHP中文网2713 days ago1057

reply all(2)I'll reply

  • 滿天的星座

    滿天的星座2017-05-17 10:02:57

    The path to springmvc.xml is wrong, resulting in the xml file being unable to be found and reading failing

    reply
    0
  • 習慣沉默

    習慣沉默2017-05-17 10:02:57

    Solved because the environment variable classpath is not set
    .;%JAVA_HOME%libdt.jar;%JAVA_HOME%libtools.jar

    reply
    0
  • Cancelreply