ssm整合遇到的第一个问题,谨记

org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [spring-dao.xml]
Offending resource: class path resource [applicationContext.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [spring-dao.xml]; nested exception is com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 1 字节的 UTF-8 序列的字节 1 无效。

    

错误原因

在xml中添加了中文注释

<!--1.扫描service下的包-->
<contex:component-scan base-package="com.jie.service"/>

解决办法;

把xml中的UTF-8改为UTF8

<?xml version="1.0" encoding="UTF8"?>

参考连接:https://blog.csdn.net/qq_45800640/article/details/116853891

上一篇:我遇到的安卓小问题


下一篇:yml报错:报错信息:panic: While parsing config: yaml: line 9: mapping values are not allowed in