oortcloud_domicile
oortcloud_domicile

Reputation: 850

Max string literal length is greater than 2^16 -1

In Scala 2.11 I am using the Play JSON API and when the line executes it throws an error.

val bodyParsed = Json.parse(bodyText.replaceAll("\\\\", ""))

That is because the length of bodyText is greater than 2^16 - 1.

How can I fix the problem?

I came across this post but I'm not sure whether it's the solution in my case.

Upvotes: 1

Views: 870

Answers (1)

oortcloud_domicile
oortcloud_domicile

Reputation: 850

Sorry this has nothing to do with the size of the string. I was able to capture my error in to a variable and see. it looks like the string i am getting is not JSON compliant and was throwing an error.

Upvotes: 1

Related Questions