简体   繁体   English

com.fasterxml.jackson.core.JsonParseException是否为* .json.swp?

[英]com.fasterxml.jackson.core.JsonParseException for *.json.swp?

I have a JSON file that i want to deserialize by Jackson ObjectMapper 我有一个要由Jackson ObjectMapper反序列化的JSON文件

    private static ObjectMapper objectMapper = new ObjectMapper();
    objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);

    ...
    Foo foo1 = objectMapper.readValue(file, Foo.class);

the JSON file is valid(used a lint checker thing). JSON文件有效(用于皮棉检查器)。 the json file name looks like: json文件名看起来像:

foo_(baz)_qux_-bar-quuz-corg-thud.json

the stack trace looks like: 堆栈跟踪如下所示:

   com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'b0VIM': was expecting ('true', 'false' or 'null')
     at [Source: .../.foo_(baz)_qux_-bar-quuz-corg-thud.json.swp; line: 1, column: 7]
   [testng]     at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1702)
    ...

why is it saying it's having trouble with a token in the swap file? 为什么说交换文件中的令牌有问题? and the String b0VIM is not anywhere in the .json file. 而字符串b0VIM不在b0VIM文件中的任何位置。 could the "(" be throwing it off? 可以将“(”扔掉吗?

what could I be missing? 我可能会缺少什么?

thanks! 谢谢!

You're trying to de-serialize a VIM Swap file . 您正在尝试反序列化VIM交换文件
Usually those temporary files, which contains metadata on what you changed inside a file with the VIM editor, starts with b0VIM ( docs ). 通常,这些临时文件以b0VIMdocs )开头,这些临时文件包含有关您在VIM编辑器中更改的内容的元数据。

Swap files have the .swp extension, and in fact the file name is 交换文件的扩展名为.swp ,实际上文件名为

foo_(baz)_qux_-bar-quuz-corg-thud.json.swp

Swap files do not contain valid JSON. 交换文件不包含有效的JSON。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 找不到com.fasterxml.jackson.core.JsonParseException的类文件 - class file for com.fasterxml.jackson.core.JsonParseException not found Spring Boot com.fasterxml.jackson.core.JsonParseException:无法识别的令牌 - Spring Boot com.fasterxml.jackson.core.JsonParseException: Unrecognized token 异常:com.fasterxml.jackson.core.JsonParseException:HttpMessageNotReadableException - Exception:com.fasterxml.jackson.core.JsonParseException:HttpMessageNotReadableException com.fasterxml.jackson.core.JsonParseException:意外的字符 - com.fasterxml.jackson.core.JsonParseException: Unexpected character 错误 com.fasterxml.jackson.core.JsonParseException:无法识别的令牌 - Error com.fasterxml.jackson.core.JsonParseException: Unrecognized token com.fasterxml.jackson.core.JsonParseException:读取json文件时出现意外字符(代码160) - com.fasterxml.jackson.core.JsonParseException: Unexpected character(code 160) while reading the json file 引起:com.fasterxml.jackson.core.JsonParseException:无法识别的令牌'okhttp3':期待(JSON字符串') - Caused by: com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'okhttp3': was expecting (JSON String') com.fasterxml.jackson.core.JsonParseException:无法识别的令牌'Hello':期待(JSON字符串,数字,数组,) - com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'Hello': was expecting (JSON String, Number, Array,) com.fasterxml.jackson.core.JsonParseException:意外的字符('\\'(代码92))[Java] - com.fasterxml.jackson.core.JsonParseException: Unexpected character ('\' (code 92)) [Java] Google Http客户端库Java:com.fasterxml.jackson.core.JsonParseException:意外字符(“ G” - Google Http Client Library java: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('G'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM