[英]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 ). 通常,这些临时文件以
b0VIM
( docs )开头,这些临时文件包含有关您在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.