Cause: org.apache.ibatis.builder.BuilderException:MalformedByteSequenceException: 1 字节的 UTF-8 序列的字节

D:\environment\java\java08\jdk8\bin\java.exe -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2019.3.3\lib\idea_rt.jar=55715:C:\Program Files\JetBrains\IntelliJ IDEA 2019.3.3\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA 2019.3.3\lib\idea_rt.jar;C:\Program Files\JetBrains\IntelliJ IDEA 2019.3.3\plugins\junit\lib\junit5-rt.jar;C:\Program Files\JetBrains\IntelliJ IDEA 2019.3.3\plugins\junit\lib\junit-rt.jar;D:\environment\java\java08\jdk8\jre\lib\charsets.jar;D:\environment\java\java08\jdk8\jre\lib\deploy.jar;D:\environment\java\java08\jdk8\jre\lib\ext\access-bridge-64.jar;D:\environment\java\java08\jdk8\jre\lib\ext\cldrdata.jar;D:\environment\java\java08\jdk8\jre\lib\ext\dnsns.jar;D:\environment\java\java08\jdk8\jre\lib\ext\jaccess.jar;D:\environment\java\java08\jdk8\jre\lib\ext\jfxrt.jar;D:\environment\java\java08\jdk8\jre\lib\ext\localedata.jar;D:\environment\java\java08\jdk8\jre\lib\ext\nashorn.jar;D:\environment\java\java08\jdk8\jre\lib\ext\sunec.jar;D:\environment\java\java08\jdk8\jre\lib\ext\sunjce_provider.jar;D:\environment\java\java08\jdk8\jre\lib\ext\sunmscapi.jar;D:\environment\java\java08\jdk8\jre\lib\ext\sunpkcs11.jar;D:\environment\java\java08\jdk8\jre\lib\ext\zipfs.jar;D:\environment\java\java08\jdk8\jre\lib\javaws.jar;D:\environment\java\java08\jdk8\jre\lib\jce.jar;D:\environment\java\java08\jdk8\jre\lib\jfr.jar;D:\environment\java\java08\jdk8\jre\lib\jfxswt.jar;D:\environment\java\java08\jdk8\jre\lib\jsse.jar;D:\environment\java\java08\jdk8\jre\lib\management-agent.jar;D:\environment\java\java08\jdk8\jre\lib\plugin.jar;D:\environment\java\java08\jdk8\jre\lib\resources.jar;D:\environment\java\java08\jdk8\jre\lib\rt.jar;D:\狂神\Mybatis-study\mybatis-01\target\test-classes;D:\狂神\Mybatis-study\mybatis-01\target\classes;D:\Apache\Maven\apache-maven-3.6.1\maven_repository\junit\junit\4.12\junit-4.12.jar;D:\Apache\Maven\apache-maven-3.6.1\maven_repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;D:\Apache\Maven\apache-maven-3.6.1\maven_repository\org\mybatis\mybatis\3.5.3\mybatis-3.5.3.jar;D:\Apache\Maven\apache-maven-3.6.1\maven_repository\junit\junit\4.13\junit-4.13.jar;D:\Apache\Maven\apache-maven-3.6.1\maven_repository\mysql\mysql-connector-java\8.0.18\mysql-connector-java-8.0.18.jar;D:\Apache\Maven\apache-maven-3.6.1\maven_repository\com\google\protobuf\protobuf-java\3.6.1\protobuf-java-3.6.1.jar" com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit4 com.donmo.daoTest.LessonMapperTest,addLesson

java.lang.ExceptionInInitializerError
	at com.donmo.daoTest.LessonMapperTest.addLesson(LessonMapperTest.java:44)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)
Caused by: org.apache.ibatis.exceptions.PersistenceException: 
### Error building SqlSession.
### The error may exist in com/donmo/dao/LessonMapper.xml
### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance.  Cause: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 1 字节的 UTF-8 序列的字节 1 无效。
	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
	at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:80)
	at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:64)
	at com.donmo.utils.MybatisUtils.<clinit>(MybatisUtils.java:19)
	... 23 more
Caused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance.  Cause: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 1 字节的 UTF-8 序列的字节 1 无效。
	at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:121)
	at org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:98)
	at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:78)
	... 25 more
Caused by: org.apache.ibatis.builder.BuilderException: Error creating document instance.  Cause: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 1 字节的 UTF-8 序列的字节 1 无效。
	at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:263)
	at org.apache.ibatis.parsing.XPathParser.<init>(XPathParser.java:127)
	at org.apache.ibatis.builder.xml.XMLMapperBuilder.<init>(XMLMapperBuilder.java:80)
	at org.apache.ibatis.builder.xml.XMLConfigBuilder.mapperElement(XMLConfigBuilder.java:373)
	at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:119)
	... 27 more
Caused by: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 1 字节的 UTF-8 序列的字节 1 无效。
	at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:701)
	at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:567)
	at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1793)
	at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.scanData(XMLEntityScanner.java:1292)
	at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanComment(XMLScanner.java:778)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanComment(XMLDocumentFragmentScannerImpl.java:1039)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2985)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
	at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:261)
	... 31 more


Process finished with exit code -1

这里我们是在mybatis 中dao层Mapper中对用的Mapper.xml文件中写入了中文注释,或者其他中文字符,删除就好了
Cause: org.apache.ibatis.builder.BuilderException:MalformedByteSequenceException: 1 字节的 UTF-8 序列的字节_第1张图片

你可能感兴趣的:(Cause: org.apache.ibatis.builder.BuilderException:MalformedByteSequenceException: 1 字节的 UTF-8 序列的字节)