Spring整合Mybatis报错解决之道

2020-12-13 02:47

阅读:320

标签:frame   ram   mvc   utf-8   timeout   for   spring   otf   url   

报错

org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [spring/springmvc-context.xml]; nested exception is java.io.FileNotFoundException: class path resource [spring/springmvc-context.xml] cannot be opened because it does not exist
Web.xml:

报错原因:

classpath:到你的class路径中查找文件,

classpath*:不仅包含class的路径,还包括jar文件中(class路径)进行查找

解决办法:在classpath后面在上“*” 可解决问题,“classpath*:springmvc.xml”

我的web.xml如下

atcrowdfundingcontextConfigLocationclasspath*:spring/spring-*.xmlorg.springframework.web.context.ContextLoaderListenerencodingorg.springframework.web.filter.CharacterEncodingFilterencodingUTF-8forceEncodingtrueencoding/*HiddenHttpMethodFilterorg.springframework.web.filter.HiddenHttpMethodFilterHiddenHttpMethodFilterspringmvcspringmvcorg.springframework.web.servlet.DispatcherServletcontextConfigLocation classpath*:spring/springmvc-context.xml
        1springmvc*.htm*.do60index.jsp

  标红的那一行缺少一个*

Spring整合Mybatis报错解决之道

标签:frame   ram   mvc   utf-8   timeout   for   spring   otf   url   

原文地址:https://www.cnblogs.com/Lovis/p/11055038.html


评论


亲,登录后才可以留言!