Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Facing "INVALID_RESPONSE_FORMAT" error in the GWT console

    Hi,

    I am facing "INVALID_RESPONSE_FORMAT" error when trying to fetch data from table. In GWT console, I see SUCCESS initially, then it moved to invalid response format.
    We are migrating,
    1. SmartGwt from 3.1 to 6.1
    2. GWT version 2.7.0
    3. Java version 1.7






    Thanks,
    Manjula
    Attached Files

    #2
    The error INVALID_RESPONSE_FORMAT means that the response was in an invalid format.

    You should review the response and see if it is in fact in an invalid format.

    If you think it's in a valid format and the framework should not have signaled this error, then let us know, but obviously we would need to see the request and response and the DataSource.

    Comment


      #3
      Hi Isomorphic,

      Thanks for your reply.

      I have taken a look on my JSON response generated, and found "[FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]é[/SIZE][/FONT][/SIZE][/FONT]" special character causing the issue. The French characters at the end of the string(i.e "This is [FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]entité[/SIZE][/FONT][/SIZE][/FONT]") causing the invalid JSON response. So the response is not set into the binding component (i.e) ListGrid.

      Please let me know how do we over come this issue.

      Note: We are migrating from smartGWT 3.1 to 6.1[SIZE=2]p20171121[/SIZE]



      Thanks,
      Manjula

      Comment


        #4
        We don't know how you are delivering data to the browser, because you still haven't shown us the DataSource involved.

        If you were using our server product, this encoding would already be handled for you.

        It sounds as though you are using some other way of encoding your data as JSON, and it's not encoding characters properly, so you will need to fix that.

        Comment


          #5
          Hi Isomorphic,

          Please find our datasource file being used. We face the issue while we fetch data from the table to grid.
          And we don't do any encoding separately.

          <DataSource ID="Group" serverType="sql" schema="dbo" dbName="ldg_JNDI"
          tableName="GROUP" xmlns:fmt="WEB-INF/" dataSourceVersion="1">
          <fmt:bundle basename="com.abc.xproducts.ldg.server.i18n.DSConstants" />
          <fields>
          <field name="ID_GROUP" type="sequence" primaryKey="true"><title><fmt:message key="group_id" /></title></field>
          <field name="ROLE" type="text" length="50"><title><fmt:message key="group_name" /></title></field>
          <field name="DESCRIPTION" type="text" length="250"><title><fmt:message key="group_description" /></title></field>

          </fields>
          </Datasource>


          Thanks,
          Manjula

          Comment


            #6
            We've got multiple automated test cases showing that accent characters such as the one you showed above are correctly quoted and delivered to browsers without an issue.

            To look further here, we're going to need a ready-to-run, minimal test case showing a DataSource and a database population script, so we can reproduce the claimed issue.

            Please also let us know which browser(s) show this error, and which do not, if there's a difference.

            Comment


              #7
              Hi Isomorphic,

              Please see my response below,
              1. We use the IE 11.0 browser (restricted to use the application in IE).

              2. You can use the below script for producing table data,
              Insert into GROUP (ROLE, DESCRIPTION) values ("Admin", "quatrième dérogation - Sureté");
              Insert into GROUP (ROLE, DESCRIPTION) values ("SuperUser", "dérogation - RSSI");

              3. When I looked on to the response generated after dsResponse.execute() method,
              [{DESCRIPTION=quatrième dérogation - Sureté, ROLE=Admin, ID_GROUP=01}, {DESCRIPTION=dérogation - RSSI, ROLE=SuperUser, ID_GROUP=02}]
              It is good, data stored in the DB is fetched as expected.

              But when we see the SmartGWT console, we cannot see the accent character mapped correctly.
              response text: [{"affectedRows":0,"data":[{"DESCRIPTION":"quatri� d�gation - it�uret�"ROLE":"Admin","ID_GROUP":01},{"DESCRIPTION":"d�gation - RSSI","ROLE":"Superuser","ID_GROUP":02}],"endRow":02,"invalidateCache":false,"isDSResponse":true,"operationType":"fetch","queueStatus":0,"startRow":0,"status":0,"totalRows":02}]




              Thanks,
              Manjula

              Comment


                #8
                Please see the Internationalization overview in the JavaDoc. We will automatically set encoding to UTF-8 but it looks like you may have overridden this. This will be easy to see in your HTTP response headers.

                Comment


                  #9
                  Thanks for the reply.

                  I see the response generated in Server-side is good. But smartGWT try to bind the data to Client, above issue happens.
                  In F12 Developer Console we can see the JSON generated is valid, but when we look into the smartGWT console we can see the JSON generation is incorrect.
                  May I know do we miss out any configuration for this encoding ?

                  Please let us know for more information.

                  Note: we do not explicitly doing any encoding(Internalization).
                  Attached Files

                  Comment


                    #10
                    We've already covered all of this:

                    Please see the Internationalization overview in the JavaDoc. We will automatically set encoding to UTF-8 but it looks like you may have overridden this. This will be easy to see in your HTTP response headers.
                    To look further here, we're going to need a ready-to-run, minimal test case showing a DataSource and a database population script, so we can reproduce the claimed issue.

                    Comment

                    Working...
                    X