Byte 1 of the UTF-8 sequence of the java.lang.runtimeexception:org.dom4j.documentexception:1 byte is invalid.

Source: Internet
Author: User

An exception occurred writing to an XML file

Workaround: Use Notepad to open the XML file, save As, encode select UTF-8

Byte 1 of the UTF-8 sequence of the java.lang.runtimeexception:org.dom4j.documentexception:1 byte is invalid.
At Cn.itcast.user.dao.UserDao.add (userdao.java:65)
At Test.dao.UserDaoTest.testAdd (userdaotest.java:23)
At Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
At Sun.reflect.NativeMethodAccessorImpl.invoke (nativemethodaccessorimpl.java:57)
At Sun.reflect.DelegatingMethodAccessorImpl.invoke (delegatingmethodaccessorimpl.java:43)
At Java.lang.reflect.Method.invoke (method.java:606)
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.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run (junit4testreference.java:86)
At Org.eclipse.jdt.internal.junit.runner.TestExecution.run (testexecution.java:38)
At Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (remotetestrunner.java:459)
At Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (remotetestrunner.java:675)
At Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run (remotetestrunner.java:382)
At Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main (remotetestrunner.java:192)
caused byte 1 of the by:org.dom4j.documentexception:1 byte of the UTF-8 sequence is invalid.
At Org.dom4j.io.SAXReader.read (saxreader.java:468)
At Org.dom4j.io.SAXReader.read (saxreader.java:307)
At Cn.itcast.user.dao.UserDao.add (userdao.java:44)
... More
caused byte 1 of the by:com.sun.org.apache.xerces.internal.impl.io.malformedbytesequenceexception:1 byte of the UTF-8 sequence is invalid.
At Com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte (utf8reader.java:687)
At Com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read (utf8reader.java:557)
At Com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load (xmlentityscanner.java:1735)
At Com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.scanLiteral (xmlentityscanner.java:1059)
At Com.sun.org.apache.xerces.internal.impl.XMLScanner.scanAttributeValue (xmlscanner.java:835)
At Com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanAttribute (Xmlnsdocumentscannerimpl.java : 439)
At Com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement ( xmlnsdocumentscannerimpl.java:255)
At Com.sun.org.apache.xerces.internal.impl.xmldocumentfragmentscannerimpl$fragmentcontentdriver.next ( xmldocumentfragmentscannerimpl.java:2786)
At Com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next (xmldocumentscannerimpl.java:606)
At Com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next (xmlnsdocumentscannerimpl.java:117)
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.AbstractSAXParser.parse (abstractsaxparser.java:1213)
At Com.sun.org.apache.xerces.internal.jaxp.saxparserimpl$jaxpsaxparser.parse (saxparserimpl.java:648)
At Org.dom4j.io.SAXReader.read (saxreader.java:449)
... More

Byte 1 of the UTF-8 sequence of the java.lang.runtimeexception:org.dom4j.documentexception:1 byte is invalid.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.