当前位置: 首页 > 知识库问答 >
问题:

“无法识别的标记'com':需要('true'、'false'或'null')”

马宜民
2023-03-14
{
        "type": "file",
        "id": "b665ff0b-5f7b-4991-ae88-ac5054880223",
        "link": {
            "href": "https://s3-eu-west-com/87e9edff-e7bd-49ea-aa7a-8948cac29bc1/b665ff0b-5f7b-4991-ae88-ac5054880223.jpg"
        },
        "file_name": "sony 431.jpg",
        "mime_type": "image/jpeg",
        "file_size": 66727,
        "public": true,
        "meta": {
            "dimensions": {
                "width": 1500,
                "height": 1500
            },
            "timestamps": {
                "created_at": "2018-01-22T11:07:35.527Z"
            }
        },
        "links": {
            "current": "https://api.e-com.com/v2/files/b665ff0b-5f7b-4991-ae88-ac5054880223"
        }
    }
staticFile1.setFile(file.toString());
File file1 = new ObjectMapper().readValue(file, File.class);

共有1个答案

艾令秋
2023-03-14

我想你得到了这样一个错误

无法识别的令牌“com”:在[source:(String)\“com.jwt.secured.user.applicationuser@6d9cce48:username:justiuser;password:[PROTECTED];enabled:true;accountnonexpective:true;credentialsnonexpective:true;accountnonlocked:true;未授予任何权限\”;行:1,列:4]“

com与字符串中的包引用相关。在类中给出正确的toString()实现,并使用objectmapper().WriteValueasString转换为String。

 类似资料: