【问题标题】:Expecting 'STRING', got 'EOF'期待'STRING',得到'EOF'
【发布时间】:2020-06-29 08:58:29
【问题描述】:

我正在尝试为 Ubiquiti 防火墙创建一个 config.gateway.json 文件,我需要将文件上传到它。我去网站 jsonlint.com 并尝试在其中运行以下内容:

{
    "LOAD_BALANCE": {
        "description": "LOAD_BALANCE",
        "rule": {
            "2000": {
                "action": "modify",
                "modify": {
                    "lb-group": "wan2_failover"
            },
            "source": {
                "address": "172.16.7.0/24"
            },
            "interfaces": {
                "bridge": {
                    "br0": {
                            "aging": "300",
                            "bridged-conntrack": "disable",
                            "hello-time": "2",
                            "max-age": "20",
                            "priority": "32768",
                            "promiscuous": "disable",
                            "stp": "false"
                    }
                },
                "load-balance": {
                    "group": {
                        "wan2_failover": {
                            "flush-on-active": "disable",
                            "interface": {
                                "br0": {
                                    "failover-only": "''"
                                },
                                "eth0": "''"
                            },
                            "lb-local": "enable",
                            "lb-local-metric-change": "enable"
                        },

但我收到错误 Expecting 'STRING', got 'EOF'

如果有一位优秀的 Java 大师可以帮助我,我将不胜感激!

【问题讨论】:

  • 你的json文件不完整

标签: java json


【解决方案1】:

看起来你的 JSON 有一些不平衡的大括号。也许这就是你所追求的:

{
    "LOAD_BALANCE": {
        "description": "LOAD_BALANCE",
        "rule": {
            "2000": {
                "action": "modify",
                "modify": {
                    "lb-group": "wan2_failover"
                },
                "source": {
                    "address": "172.16.7.0/24"
                },

                "interfaces": {
                    "bridge": {
                        "br0": {
                            "aging": "300",
                            "bridged-conntrack": "disable",
                            "hello-time": "2",
                            "max-age": "20",
                            "priority": "32768",
                            "promiscuous": "disable",
                            "stp": "false"
                        }
                    },

                    "load-balance": {
                        "group": {
                            "wan2_failover": {
                                "flush-on-active": "disable",
                                "interface": {
                                    "br0": {
                                        "failover-only": "''"
                                    },
                                    "eth0": "''"
                                },
                                "lb-local": "enable",
                                "lb-local-metric-change": "enable"
                            }
                        }
                    }
                }
            }
        }
    }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-09-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-08-13
    • 1970-01-01
    • 1970-01-01
    • 2012-08-13
    相关资源
    最近更新 更多