JSON parsing error on update

Posted by Roland de Pijper on 10-Sep-2014 09:10

Hi all,

when updating a record i get a JSON parsing error on the OE Appserver: 15360. This happens when there is a decimal field in the record with a zero value. This happens with Rollbase V3 in combination with OE 11.4.

Simply reproducable by creating an OE Businessentity for customer in the sports2000 database and import this as a Rollbase object. The error occurs on customer number 12. 

Anyone seen this before?

Posted by egarcia on 10-Sep-2014 10:57

Hello Roland,

The issue here is that the value 000 is not expected in the JSON format.

The site http://jsonlint.com/ confirms this.

I took a look at http://json.org/ and notice that the definition for a number is the following:

number

   int

   int frac

   int exp

   int frac exp

int

   digit

   digit1-9 digits

   - digit

   - digit1-9 digits

This definition shows that leading digits have to be from 1 to 9.

I would suggest to submit a bug report for this issue so that 0 is generated instead of 000.

Thanks.

All Replies

Posted by egarcia on 10-Sep-2014 09:27

Hello,

I have not seen this issue before.

Could you share the JSON used by Rollbase in the request and the response?

You can find the JSON in the jsdo.log file in rollbase/storage/1/log.

Thanks.

Posted by Roland de Pijper on 10-Sep-2014 10:21

Hi Edsel,

belows is the logging of the request/response. As you can see the balance field is 000. It looks like this is interpreted as integer while we expect a decimal:

[2014-09-10 16:02:32,044] ttCustomer: Filter: CustNum=12

[2014-09-10 16:02:32,046] http://localhost:8980/Customer/rest/Customer/btCustomer?filter=CustNum%3D12

[2014-09-10 16:02:32,052] ttCustomer: Response: Chars: 393, a117: 1

[2014-09-10 16:02:40,071] ttCustomer: Filter: CustNum=12

[2014-09-10 16:02:40,073] http://localhost:8980/Customer/rest/Customer/btCustomer?filter=CustNum%3D12

[2014-09-10 16:02:40,080] ttCustomer: Response: Chars: 393, a117: 1

[2014-09-10 16:02:40,083] Update ttCustomer: request

{"dsCustomer":{"ttCustomer":[{"Phone": "(51) 254 2180", "Comments": null, "Contact": "Veikko Lehtisoini", "Fax": null, "Terms": "Net30", "CustNum": 12, "Country": "Finland", "City": "Salo", "CustId": null, "Name": "Surf Lautaveikkoset", "PostalCode": "24240", "State": "Varsinais-Suomi", "Address2": null, "Address": "Venemestarinkatu 36", "EmailAddress": null, "SalesRep": "DKP", "Discount": 35, "Balance": 000, "CreditLimit": 650}]}}

[2014-09-10 16:02:40,096] Communication error:{"_errors":[{"_errorMsg":"ERROR condition: Incomplete Client aanvraag. (8020) (7211)","_errorNum":8020}]}

Posted by egarcia on 10-Sep-2014 10:57

Hello Roland,

The issue here is that the value 000 is not expected in the JSON format.

The site http://jsonlint.com/ confirms this.

I took a look at http://json.org/ and notice that the definition for a number is the following:

number

   int

   int frac

   int exp

   int frac exp

int

   digit

   digit1-9 digits

   - digit

   - digit1-9 digits

This definition shows that leading digits have to be from 1 to 9.

I would suggest to submit a bug report for this issue so that 0 is generated instead of 000.

Thanks.

Posted by Bill Wood on 11-Sep-2014 01:56

Quick Question:  I just tried to reproduce this and did not have the issue.   I am wondering if you have the European format for Decimal set up in either OpenEdge or in Rollbase.   For me, I had the value of the Balance shown as "Decimal" In Rollbase with the period as the decimal separator "0.00".

Did you have the 'default' for Balance here?  Decimal as "0.00", or were you set up for "0,00" or as Currency?

Posted by egarcia on 11-Sep-2014 05:52

I would expect the data sent from OpenEdge to be 0 since it should be valid JSON.

(This can be confirmed by looking a the jsdo.log file or using a proxy to see the data sent via HTTP/S requests.)

Could this be caused by a format option in Rollbase?

Posted by Roland de Pijper on 11-Sep-2014 06:39

Good question Bill!

My OE session is running in European format, so with the ',' as separator. I've changed the format and default value of the balance field to Comma separator respectively ','. And that works!

So it seems that, in case of a dispcrepancy in the Decimal separator setup a zero value is represented in the json file as 000 instead of 0.

If you agree, i will create a support ticket for this.

Posted by Bill Wood on 11-Sep-2014 07:06

I am not 100% sure I understand what you changed….
 
Did you change the OE side or the Rollbase side?   You say you “changed the format and the default value of the balance field” (but I was unclear where you did that).
 
Yes.  It sounds like a defect in the serialization of the decimal field in Rollbase, if that is where you changed the format.

Posted by Roland de Pijper on 11-Sep-2014 07:23

I changed the format in Rollbase.

Will make a support ticket.

This thread is closed