亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

為什么我的錯誤是這樣的 文件是utf8 不是bom

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring/spring-dao.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'class path resource [maper]'; nested exception is org.apache.ibatis.builder.BuilderException: Error creating document instance. ?Cause: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; 前言中不允許有內容。


正在回答

2 回答

我的問題是應為 spring 配置mapper 寫錯了 少寫了/*.xml

0 回復 有任何疑惑可以回復我~

解決方法:

1、確保xml的第一句<?xml version="1.0" encoding="UTF-8"?>之前沒有空格。

2、復制網上的xml文件的時候,建議這一句<?xml version="1.0" encoding="UTF-8"?>不要復制,保留生成文件的時候生成的這句代碼<?xml version="1.0" encoding="UTF-8"?>,這樣就能避免這種bug出現。


0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

為什么我的錯誤是這樣的 文件是utf8 不是bom

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號