IBM / detect-timeseriesdata-change

WARNING: This repository is no longer maintained :warning: This repository will not be updated. The repository will be kept available in read-only mode.
https://developer.ibm.com/patterns/detect-change-points-in-iot-sensor-data
Apache License 2.0
21 stars 22 forks source link

Error reading json configuration file #6

Closed cenyuzhang closed 7 years ago

cenyuzhang commented 7 years ago

when reading from the json configuration file, I got the following error. jsonlite version i have is 1.5

Error: lexical error: invalid char in json text.

Forbidden

Acce (right here) ------^ Traceback: 1. fromJSON(readLines(getObjectStorageFileWithCredentials_db8e182e477e43d185da8da8a5ddfecc("ChangePointDetection", . v_sampleConfigFileName))) 2. fromJSON_string(txt = txt, simplifyVector = simplifyVector, simplifyDataFrame = simplifyDataFrame, . simplifyMatrix = simplifyMatrix, flatten = flatten, ...) 3. parseJSON(txt, bigint_as_char) 4. parse_string(txt, bigint_as_char) error

stevemar commented 7 years ago

@ManjulaGHM @vchahalibm see above issue

dkprabu commented 7 years ago

Looks like there seems to be a issue with your .json file "cpd_dsx_config.json" Please verify the content and format of your .json file again. I have provided the contents of the original .json file template. Cut paste this into your .json and change only the values leaving alone other areas.

[ { "paramname": "coltimestamp", "paramvalue": "TIMESTAMP" }, { "paramname": "colsensorid", "paramvalue": "SENSORID" }, { "paramname": "colsensorvalue", "paramvalue": "SENSORVALUE" }, { "paramname": "sensorid", "paramvalue": "3B1" }, { "paramname": "datatimeformat", "paramvalue": "%d-%m-%Y %H:%M:%S" }, { "paramname": "intimezone", "paramvalue": "GMT" }, { "paramname": "rangetimeformat", "paramvalue": "%Y%m%d %H:%M:%S" }, { "paramname": "Pfrom", "paramvalue": "20160324 00:00:00" }, { "paramname": "Pto", "paramvalue": "20160325 00:00:00" }, { "paramname": "Cfrom", "paramvalue": "20160325 00:00:00" }, { "paramname": "Cto", "paramvalue": "20160326 00:00:00" }, { "paramname": "thresholdpercent", "paramvalue": 25 } ]

dkprabu commented 7 years ago

Do confirm if this works, elase pass me the contents of your .json file, let me have a look

cenyuzhang commented 7 years ago

@dkprabu thanks. Here is my .json config file. It looks the same as yours. Please let me know if there is is any issue with the file. (renamed to .txt since github doesn't accept .json attachment)

cpd_dsx_config.txt

dkprabu commented 7 years ago

@cenyuzhang I tried reading your json file and I am able to do so without any issues in my instance of DSX. So, there is no issue with your json file content. I have attached the steps to read the json file in the attachement. Please follow those and let me know if it works for you.

CPD_Issue6_20170912.docx

dkprabu commented 7 years ago

@cenyuzhang and try this too.. if the problem persists.. https://github.com/jeroen/jsonlite/issues/106

cenyuzhang commented 7 years ago

@dkprabu thanks! the issue was solved. I will close the issue.