-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 6.2.X EE, 7.0.0 DXP SP1
-
Fix Version/s: 6.2.X EE, 7.0.0 DXP FP3, 7.0.0 DXP SP1, Master
-
Component/s: Legacy Components, Legacy Components > API
-
Branch Version/s:7.0.x, 6.2.x
-
Backported to Branch:Committed
-
Story Points:1
-
Git Pull Request:
Description:
If a JSONObject.toString() results in a string larger than 65535 characters and the JSONObject is being serialized, an UTFDataFormatExeption is thrown.
It looks like this is because JSONObjectImpl.writeExternal uses objectOutput.writeUTF which has a hard limit of 65535 bytes. There's a similar constraint in readInternal.
This issue is reproduced with JSONArray as well.
Steps to Reproduce:
- Start a Liferay Instance.
- Navigate to Control Panel > Server Administration > Script.
- Run the attached Groovy Script: test_jsonobject_jsonarray_externalizable.groovy
Expected:
Script runs successfully for both JSONObject and JSONArray.
Actual:
Script fails: java.io.UTFDataFormatException
- is related to
-
LPS-108120 CacheModels use ObjectOutput#writeUTF to cache String fields
- Closed
- relates
-
LPE-15332 Large JSON Objects cannot be properly serialized and result in UTFDataFormatException
-
- Closed
-