stanfordnlp/CoreNLP · info

You probably cannot read the serialized output, so printing…

Error message

You probably cannot read the serialized output, so printing in text instead

What it means

In the interactive shell of StanfordCoreNLPServer's client, if the requested output format is SERIALIZED, the shell prints this warning and falls back to plain-text output, because serialized binary output is not readable in an interactive console. It is an informational fallback, not a failure — annotation results are still printed as text.

Solutions

  1. Restart the shell with -outputFormat text (or json) to get readable output
  2. Use JSON output if you need structured data: -outputFormat json
  3. Keep serialized format only for scripted/batch mode where the output is consumed by a program, not the shell

Example fix

// before
java -cp stanford-corenlp.jar edu.stanford.nlp.pipeline.StanfordCoreNLPServer -outputFormat serialized
// after
java -cp stanford-corenlp.jar edu.stanford.nlp.pipeline.StanfordCoreNLPServer -outputFormat text
Defensive patterns

Strategy: fallback

Validate before calling

// choose a shell-readable format before launching
String fmt = System.getProperty("outputFormat", "text");
if ("serialized".equals(fmt) && interactiveShell) fmt = "text";

Prevention

When it happens

Trigger: Starting the CoreNLP client shell (shell mode of StanfordCoreNLPServer/client) with -outputFormat serialized, then entering a query interactively; the shell's switch on OutputFormat hits the SERIALIZED case.

Common situations: Developers testing the server with default serialization output format while using the interactive shell to eyeball results.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of stanfordnlp/CoreNLP@1b7edd19c4 (2026-09-10). Data as JSON: /api/errors/be0591d9c4fc9088. Report an issue: GitHub.

Appendix: source

Thrown at src/edu/stanford/nlp/pipeline/StanfordCoreNLPClient.java:614

        Annotation anno = pipeline.process(line);
        try {
          switch (outputFormat) {
            case XML:
              new XMLOutputter().print(anno, System.out);
              break;
            case JSON:
              new JSONOutputter().print(anno, System.out);
              System.out.println();
              break;
            case CONLL:
              new CoNLLOutputter().print(anno, System.out);
              System.out.println();
              break;
            case TEXT:
              new TextOutputter().print(anno, System.out);
              break;
            case SERIALIZED:
              warn("You probably cannot read the serialized output, so printing in text instead");
              new TextOutputter().print(anno, System.out);
              break;
            default:
              throw new IllegalArgumentException("Cannot output in format " + outputFormat + " from the interactive shell");
          }
        } catch (IOException e) {
          throw new RuntimeIOException(e);
        }
      }
    });
  }

  /**
   * The implementation of what to run on a command-line call of CoreNLPWebClient
   *
   * @throws IOException If any IO problem
   */
  public void run() throws IOException {

View on GitHub (pinned to 1b7edd19c4)