一、问题清单:

1.org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; 前言中不允许有内容。

2.通配符的匹配很全面, 但无法找到元素 'mvc:annotation-driven' 的声明。

3.java.io.FileNotFoundException: Could not open ServletContext resource [/jdbc.properties]

4. org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 58; 文档根元素 "mapper" 必须匹配 DOCTYPE 根 "null"。

二、详情和解决如下:

1.org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 1 in XML document from URL [file:/D:/00SoftwareInstallPacakge/tomcats/apache-tomcat-7.0.69-windows-x64/apache-tomcat-7.0.69/lib/] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; 前言中不允许有内容。

解决:

手把手教你使用idea建SSM工程(三)——问题篇

新建一个spring配置文件(开启mvc注解和默认handler),并将标注处更改为如下图所示

手把手教你使用idea建SSM工程(三)——问题篇

2.通配符的匹配很全面, 但无法找到元素 'mvc:annotation-driven' 的声明。

解决:补上了红色标注处

手把手教你使用idea建SSM工程(三)——问题篇

3.java.io.FileNotFoundException: Could not open ServletContext resource [/jdbc.properties]

原因:找不到资源文件,

解决:在引用配置文件和属性文件的地方都加上classpath:
①applicationContext.xml

<import resource="classpath:appContext_dataSource.xml"/>

②appContext_dataSource.xml

<context:property-placeholder location="classpath:jdbc.properties"/>

4. org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 58; 文档根元素 "mapper" 必须匹配 DOCTYPE 根 "null"。

在UserMapper.xml文件中加上

<!DOCTYPE mapperPUBLIC "-//mybatis.org//DTD Mapper 3.0//EN""http://mybatis.org/dtd/mybatis-3-mapper.dtd">

相关文章:

  • 2021-04-16
  • 2021-09-08
  • 2021-12-07
  • 2021-11-05
  • 2021-11-25
猜你喜欢
  • 2021-05-25
  • 2022-12-23
  • 2021-04-16
  • 2021-09-16
  • 2021-12-07
  • 2021-11-20
  • 2021-07-08
相关资源
相似解决方案