JSON文件的内容如下:
{
  "identifier": "id",
  "label": "name",
  "items": [
    {
      "type": "schedule",
      "id": "-1",
      "name": "chkSchedule",
      "schedule": "3,7,1,2,00"
    },
    {
      "type": "devices",
      "id": "00000019bb3258ea0000000300000002",
      "name": "spa1db2",
      "deviceType": "HP9000 HP-UX B.11.23",
      "Monitoring": {
        "Status": "1",
        "StatusText": "The health check result is healthy.",
        "AdditionalInfo": "Here is the additional infromation."
      },
      "Basic Colletion": null,
      "Advanced Collection": null,
      "SAN Server Collection": null
    },
    {
      "type": "devices",
      "id": "00000019bb3258ea0000000300000010",
      "name": "cmserver",
      "deviceType": "HP9000 HP-UX B.11.11",
      "Monitoring": {
        "Status": "1",
        "StatusText": "The health check result is healthy.",
        "AdditionalInfo": "Here is the additional infromation."
      },
      "Basic Colletion": null,
      "Advanced Collection": null,
      "SAN Server Collection": null
    }
  ]
}好像是"Monitoring"这个对象的格式不对,去掉之后就可以正常读取JSON文件内的其他所有内容了,但是看不出哪里不对。
请牛人帮忙看一下,谢谢!

解决方案 »

  1.   

    这个json是合法的
    只是ItemFileWriteStore解释不了而已
    检查一下json映射对象的格式要求,看是否匹配
      

  2.   

    json映射对象的格式要求如何检查?目前传输的话,用的是text/x-json
    header('Content-type: text/x-json');
      

  3.   

    谢谢。已经解决了。
    开始在存储的时候直接用数组给JSON的属性赋值了,所以报了这个错。
    现在先转换成JSON string再存储,然后再读出来之后再用eval()把JSON String转换成JSON数组,就没有这个问题了。