{"record":{"id":"be0591d9c4fc9088","repo":"stanfordnlp/CoreNLP","slug":"you-probably-cannot-read-the-serialized-output-so","errorCode":null,"errorMessage":"You probably cannot read the serialized output, so printing in text instead","messagePattern":"You probably cannot read the serialized output, so printing in text instead","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/edu/stanford/nlp/pipeline/StanfordCoreNLPClient.java","lineNumber":614,"sourceCode":"        Annotation anno = pipeline.process(line);\n        try {\n          switch (outputFormat) {\n            case XML:\n              new XMLOutputter().print(anno, System.out);\n              break;\n            case JSON:\n              new JSONOutputter().print(anno, System.out);\n              System.out.println();\n              break;\n            case CONLL:\n              new CoNLLOutputter().print(anno, System.out);\n              System.out.println();\n              break;\n            case TEXT:\n              new TextOutputter().print(anno, System.out);\n              break;\n            case SERIALIZED:\n              warn(\"You probably cannot read the serialized output, so printing in text instead\");\n              new TextOutputter().print(anno, System.out);\n              break;\n            default:\n              throw new IllegalArgumentException(\"Cannot output in format \" + outputFormat + \" from the interactive shell\");\n          }\n        } catch (IOException e) {\n          throw new RuntimeIOException(e);\n        }\n      }\n    });\n  }\n\n  /**\n   * The implementation of what to run on a command-line call of CoreNLPWebClient\n   *\n   * @throws IOException If any IO problem\n   */\n  public void run() throws IOException {","sourceCodeStart":596,"sourceCodeEnd":632,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/pipeline/StanfordCoreNLPClient.java#L596-L632","documentation":"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.","triggerScenarios":"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.","commonSituations":"Developers testing the server with default serialization output format while using the interactive shell to eyeball results.","solutions":["Restart the shell with -outputFormat text (or json) to get readable output","Use JSON output if you need structured data: -outputFormat json","Keep serialized format only for scripted/batch mode where the output is consumed by a program, not the shell"],"exampleFix":"// before\njava -cp stanford-corenlp.jar edu.stanford.nlp.pipeline.StanfordCoreNLPServer -outputFormat serialized\n// after\njava -cp stanford-corenlp.jar edu.stanford.nlp.pipeline.StanfordCoreNLPServer -outputFormat text","handlingStrategy":"fallback","validationCode":"// choose a shell-readable format before launching\nString fmt = System.getProperty(\"outputFormat\", \"text\");\nif (\"serialized\".equals(fmt) && interactiveShell) fmt = \"text\";","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use text or json output format in interactive sessions","Reserve serialized output for programmatic batch consumers","Read the shell's warning output and adjust flags accordingly"],"tags":["nlp","cli","output-format","java"],"backgroundTag":"unsupported-operation","analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}