Uploaded image for project: 'Tika'
  1. Tika
  2. TIKA-4154

Make DEFAULT_MAX_STRING_LEN in StreamReadConstraints configurable

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • 2.9.0
    • None
    • core
    • None
    • In a Java application running with 8 GB JVM on Ubuntu OS

    Description

      In "com.fasterxml.jackson.core", in StreamReadConstraints there is a constraint of string length of 20M by DEFAULT_MAX_STRING_LEN variable. To handle larger text, we need this value to be a much larger value. We want this variable to be made configurable so that we can tweak it as per requirement.

      This constraint was added in 2.15.0 release.

      public class StreamReadConstraints
      public static final int DEFAULT_MAX_STRING_LEN = 20_000_000;

      Snippet of exception received:
      com.fasterxml.jackson.core.exc.StreamConstraintsException: String length (20054016) exceeds the maximum length (20000000) at com.fasterxml.jackson.core.StreamReadConstraints.validateStringLength(StreamReadConstraints.java:324) at com.fasterxml.jackson.core.util.ReadConstrainedTextBuffer.validateStringLength(ReadConstrainedTextBuffer.java:27) at com.fasterxml.jackson.core.util.TextBuffer.finishCurrentSegment(TextBuffer.java:939) at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._finishString2(UTF8StreamJsonParser.java:2584) at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._finishString(UTF8StreamJsonParser.java:2529) at com.fasterxml.jackson.core.json.UTF8StreamJsonParser.getTextCharacters(UTF8StreamJsonParser.java:487) at com.fasterxml.jackson.core.JsonGenerator._copyCurrentStringValue(JsonGenerator.java:2777) at com.fasterxml.jackson.core.JsonGenerator._copyCurrentContents(JsonGenerator.java:2668) at com.fasterxml.jackson.core.JsonGenerator.copyCurrentStructure(JsonGenerator.java:2619) at 

      Attachments

        Activity

          People

            Unassigned Unassigned
            ranjanvishal Vishal Ranjan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: