Announcement Announcement Module
Collapse
No announcement yet.
DBRE error --Invalid byte 2 of 2-byte UTF-8 sequence Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • DBRE error --Invalid byte 2 of 2-byte UTF-8 sequence

    Hi guys, when I run command “database reverse engineer --schema no-schema-required” to reverse engineer with a MySQL database containing Chinese description, Prompt an error:

    Updated SRC_MAIN_RESOURCES\dbre.xml
    Undo manage SRC_MAIN_RESOURCES\dbre.xml
    Invalid byte 2 of 2-byte UTF-8 sequence.
    , how to solve?

    --Development environment: WINDOWS XP SP2(Simplified Chinese), JAVA:1.6.0_31,SpringSource Tool Suite 2.9.1.RELEASE(Roo 1.2.1.RELEASE [rev 6eae723])

  • #2
    I have the same problem when I try to use "database" command!

    Originally posted by moowx View Post
    Hi guys, when I run command “database reverse engineer --schema no-schema-required” to reverse engineer with a MySQL database containing Chinese description, Prompt an error:



    , how to solve?

    --Development environment: WINDOWS XP SP2(Simplified Chinese), JAVA:1.6.0_31,SpringSource Tool Suite 2.9.1.RELEASE(Roo 1.2.1.RELEASE [rev 6eae723])
    I have the same problem when I try to use "database" command! How to solve ?

    Comment


    • #3
      Another one:

      C:\...>roo
      ____ ____ ____
      / __ \/ __ \/ __ \
      / /_/ / / / / / / /
      / _, _/ /_/ / /_/ /
      /_/ |_|\____/\____/ 1.2.1.RELEASE [rev 6eae723]


      Welcome to Spring Roo. For assistance press TAB or type "hint" then hit ENTER.
      roo> database reverse engineer --schema MY_SCHEMA --package ~.tables --testAutomatically
      Updated SRC_MAIN_RESOURCES\dbre.xml
      Undo manage SRC_MAIN_RESOURCES\dbre.xml
      Invalid byte 2 of 2-byte UTF-8 sequence.
      roo>
      What I've found weird, as far as I know, is that the error is due to a problem parsing the XML that is being generating by Roo: dbre.xml (src/main/resources)

      Maybe the problem is in some character obtained from the database that is not UTF-8 compliant. I've tried to change within the POM the property project.build.sourceEncoding from UTF-8 to iso-8859-1, but it didn't work either.

      It would be a good if Roo provided more information regarding the problem. But maybe it's not easy.

      I wish someone from Spring could help us with this problem

      Roo Environment:
      Windows 7 (32 bits)
      Java 6
      Roo 1.2.1

      DB Environment:
      Oracle v8.1

      In Spanish (international, I hope)

      Comment


      • #4
        Originally posted by jbbarquero View Post

        Maybe the problem is in some character obtained from the database that is not UTF-8 compliant. I've tried to change within the POM the property project.build.sourceEncoding from UTF-8 to iso-8859-1, but it didn't work either.
        Hi, I'm stuck in the same problem. the rare thing is that I can perform a

        database introspect --schema
        And Roo print the schema structure.

        The tables in my schema has comments with accented words and html things like:
        Code:
        <column description="Indicador de que la tarea se realizó.&#13 ;&#10 ;0: no realizada&#13 ;
        1: realizada"
        I did a test with a very simple schema and the DBRE ran perfectly.

        Comment


        • #5
          https://jira.springsource.org/browse/ROO-3214

          Comment


          • #6
            Thanks Giovanni.

            I've tried database introspect with the "--file" option and I've found the XML errors using Notepad++ (with the XML Tools plugin). With it, I could locate the very lines that was producing the error.

            <table alias="ALIAS" name="TEMPORADA">
            <column .../>
            <column name="AÑO" primaryKey="false" required="true" scale="0" size="4" type="3,NUMBER"/>

            <table alias="ALIAS" name="APLICACIÓN">
            ...
            </table>

            Comment


            • #7
              dirty workaround

              Hi all,

              I've got the same problem and I solved it by doing database introspect, copy the result from the console into notepad++, change the encoding in the XML declaration on the first line and save it as dbre.xml in the right folder, everything went smoothly after that when I called database reverse engineer.
              Only thing is that if your DB changes, you have to repeat the procedure.

              Hope it helps

              Best regards from France

              Benoit


              Originally posted by jbbarquero View Post
              Thanks Giovanni.

              I've tried database introspect with the "--file" option and I've found the XML errors using Notepad++ (with the XML Tools plugin). With it, I could locate the very lines that was producing the error.

              Comment

              Working...
              X