An error occurred while importing data from dbunit to MySQL.

Source: Internet
Author: User
C: \ Users \ Administrator \ Desktop \ defaultdb-mysql dedicated \ build. XML: 50: Org. dbunit. databaseunitexception: Java. SQL. sqlexception: incorrect string value: '\ xe3 \ X80 \ x8a \ xe8 \ XAE \ xbe... 'for column 'doccontent' at row 1at org.dbunit.ant.operation.exe cute (operation. java: 175) at org.dbunit.ant.dbunittask.exe cute (dbunittask. java: 272) at org.apache.tools.ant.unknownelement.exe cute (unknownelement. java: 291) at Sun. reflect. generatedmethodaccessor4.invoke (unknown source) at Sun. reflect. delegatingmethodaccessorimpl. invoke (delegatingmethodaccessorimpl. java: 25) at java. lang. reflect. method. invoke (method. java: 597) at org.apache.tools.ant.dispatch.dispatchutils.exe cute (dispatchutils. java: 106) at Org. apache. tools. ant. task. perform (task. java: 348) at org.apache.tools.ant.target.exe cute (target. java: 392) at Org. apache. tools. ant. target. performtasks (target. java: 413) at org.apache.tools.ant.project.exe cutesortedtargets (project. java: 1399) at org.apache.tools.ant.helper.singlecheckexecutor.exe cutetargets (singlecheckexecutor. java: 38) at org.apache.tools.ant.project.exe cutetargets (project. java: 1251) at org.apache.tools.ant.taskdefs.ant.exe cute (Ant. java: 442) at org.apache.tools.ant.taskdefs.calltarget.exe cute (calltarget. java: 105) at org.apache.tools.ant.unknownelement.exe cute (unknownelement. java: 291) at Sun. reflect. nativemethodaccessorimpl. invoke0 (native method) at Sun. reflect. nativemethodaccessorimpl. invoke (nativemethodaccessorimpl. java: 39) at Sun. reflect. delegatingmethodaccessorimpl. invoke (delegatingmethodaccessorimpl. java: 25) at java. lang. reflect. method. invoke (method. java: 597) at org.apache.tools.ant.dispatch.dispatchutils.exe cute (dispatchutils. java: 106) at Org. apache. tools. ant. task. perform (task. java: 348) at org.apache.tools.ant.target.exe cute (target. java: 392) at Org. apache. tools. ant. target. performtasks (target. java: 413) at org.apache.tools.ant.project.exe cutesortedtargets (project. java: 1399) at org.apache.tools.ant.project.exe cutetarget (project. java: 1368) at org.apache.tools.ant.helper.defaultexecutor.exe cutetargets (defaultexecutor. java: 41) at org.apache.tools.ant.project.exe cutetargets (project. java: 1251) at Org. apache. tools. ant. main. runbuild (main. java: 811) at Org. apache. tools. ant. main. startant (main. java: 217) at Org. apache. tools. ant. launch. launcher. run (launcher. java: 280) at Org. apache. tools. ant. launch. launcher. main (launcher. java: 109) Java. SQL. sqlexception: incorrect string value: '\ xe3 \ X80 \ x8a \ xe8 \ XAE \ xbe... 'for column 'doccontent' at row 1at COM. mySQL. JDBC. mysqlio. checkerrorpacket (mysqlio. java: 2928) at com. mySQL. JDBC. mysqlio. sendcommand (mysqlio. java: 1571) at com. mySQL. JDBC. serverpreparedstatement. serverexecute (serverpreparedstatement. java: 1124) at com.mysql.jdbc.serverpreparedstatement.exe cuteinternal (serverpreparedstatement. java: 676) at com.mysql.jdbc.preparedstatement.exe cute (preparedstatement. java: 773) at Org. dbunit. database. statement. simplepreparedstatement. addbatch (simplepreparedstatement. java: 67) at Org. dbunit. database. statement. automaticpreparedbatchstatement. addbatch (automaticpreparedbatchstatement. java: 57) at org.dbunit.operation.w.actbatchoperation.exe cute (abstractbatchoperation. java: 178) at org.dbunit.operation.compositeoperation.exe cute (compositeoperation. java: 67) at org.dbunit.ant.operation.exe cute (operation. java: 171) at org.dbunit.ant.dbunittask.exe cute (dbunittask. java: 272) at org.apache.tools.ant.unknownelement.exe cute (unknownelement. java: 291) at Sun. reflect. generatedmethodaccessor4.invoke (unknown source) at Sun. reflect. delegatingmethodaccessorimpl. invoke (delegatingmethodaccessorimpl. java: 25) at java. lang. reflect. method. invoke (method. java: 597) at org.apache.tools.ant.dispatch.dispatchutils.exe cute (dispatchutils. java: 106) at Org. apache. tools. ant. task. perform (task. java: 348) at org.apache.tools.ant.target.exe cute (target. java: 392) at Org. apache. tools. ant. target. performtasks (target. java: 413) at org.apache.tools.ant.project.exe cutesortedtargets (project. java: 1399) at org.apache.tools.ant.helper.singlecheckexecutor.exe cutetargets (singlecheckexecutor. java: 38) at org.apache.tools.ant.project.exe cutetargets (project. java: 1251) at org.apache.tools.ant.taskdefs.ant.exe cute (Ant. java: 442) at org.apache.tools.ant.taskdefs.calltarget.exe cute (calltarget. java: 105) at org.apache.tools.ant.unknownelement.exe cute (unknownelement. java: 291) at Sun. reflect. nativemethodaccessorimpl. invoke0 (native method) at Sun. reflect. nativemethodaccessorimpl. invoke (nativemethodaccessorimpl. java: 39) at Sun. reflect. delegatingmethodaccessorimpl. invoke (delegatingmethodaccessorimpl. java: 25) at java. lang. reflect. method. invoke (method. java: 597) at org.apache.tools.ant.dispatch.dispatchutils.exe cute (dispatchutils. java: 106) at Org. apache. tools. ant. task. perform (task. java: 348) at org.apache.tools.ant.target.exe cute (target. java: 392) at Org. apache. tools. ant. target. performtasks (target. java: 413) at org.apache.tools.ant.project.exe cutesortedtargets (project. java: 1399) at org.apache.tools.ant.project.exe cutetarget (project. java: 1368) at org.apache.tools.ant.helper.defaultexecutor.exe cutetargets (defaultexecutor. java: 41) at org.apache.tools.ant.project.exe cutetargets (project. java: 1251) at Org. apache. tools. ant. main. runbuild (main. java: 811) at Org. apache. tools. ant. main. startant (main. java: 217) at Org. apache. tools. ant. launch. launcher. run (launcher. java: 280) at Org. apache. tools. ant. launch. launcher. main (launcher. java: 109) Total time: 25 seconds

At first thought it was encoding problem, after query, found that the server side encoding and client encoding are UTF-8 encoding, so the encoding is no problem;

Run the show character set; command to find that the maximum UTF-8 encoding length is 3, which does not seem to affect the storage of all data, but it is suspected that the length of the field is limited, set the doccontent field type to longtext from text to solve the problem.

The length supported by text, mediumtext, and longtext is as follows (from MySQL 5.1 manual ):

 

Tinytext

The maximum length of a text column is 255 (28-1) characters.

Text [(M)]

A text column with a maximum length of 65,535 (216-1) characters.

Optional LengthM. MySQL creates the smallest column but is sufficient to accommodateMThe text type of the character length value.

Mediumtext

A text column with a maximum length of 16,777,215 (224-1) characters.

Longtext

A text column with a maximum length of 4,294,967,295 or 4 GB (232-1) characters. Maximum Value of the longtext ColumnValidThe length (allowed) depends on the maximum size of the package configured in the Client/Server protocol and the available memory.

Related Article

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.