成人在线亚洲_国产日韩视频一区二区三区_久久久国产精品_99国内精品久久久久久久

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

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

瀏覽:134日期:2023-12-12 09:06:40

問題描述

eclipse:Neon

tomcat:9

在學(xué)習(xí)SpringMVC時(shí),eclipse創(chuàng)建動(dòng)態(tài)web項(xiàng)目 創(chuàng)建config(source folder)和src同級(jí) 在config目錄下創(chuàng)建配置文件springmvc.xml,并在web.xml中加載java - eclipse run on server, classpath, not find springmvc.xml

項(xiàng)目run as-》run configurationjava - eclipse run on server, classpath, not find springmvc.xml報(bào)錯(cuò):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配置classpath,添加projectjava - eclipse run on server, classpath, not find springmvc.xml還是報(bào)找不到springmvc.xml in classpathCaused by: java.io.FileNotFoundException: class path resource [sprigmvc.xml] cannot be opened because it does not existjava - eclipse run on server, classpath, not find springmvc.xml

問題解答

回答1:

springmvc.xml路徑錯(cuò)了,導(dǎo)致無(wú)法找到xml文件,讀取失敗

回答2:

解決了,因?yàn)闆]有設(shè)置環(huán)境變量classpath.;%JAVA_HOME%libdt.jar;%JAVA_HOME%libtools.jar

標(biāo)簽: java