bmwcarit / barefoot

Java map matching library for integrating the map into software and services with state-of-the-art online and offline map matching that can be used stand-alone and in the cloud.
Apache License 2.0
671 stars 186 forks source link

java.lang.RuntimeException: JSON request faulty or incomplete #94

Closed shuangxia closed 6 years ago

shuangxia commented 6 years ago

Hi,

Thanks for providing the solution. I have setup the map server (docker container) and the matcher server. however when running the test cases provided, I got error message saying '''java.lang.RuntimeException: JSON request faulty or incomplete''' The job submission I used is '''python util/submit/batch.py --host localhost --port 1234 --file src/test/resources/com/bmwcarit/barefoot/matcher/x0001-015.json''' The only thing I changed in the python batch.py is instead of using 'netcat' I used 'nc', as I got 'netcat: no such command' error. sample request message looks like this: "request": [{"time": "2014-09-10 06:54:07+0200", "id": "001", "point": "POINT(11.564388282625075 48.16350662940509)"}, {"time": "2014-09-10 06:54:22+0200", "id": "001", "point": "POINT(11.563678490482323 48.16198390379898)"},...] I wonder if it's because the 'time' is not in millisecond unix epoch time format? Could you please help providing some hints on debugging?

Thank you very much!

smattheis commented 6 years ago

That could result from a different behavior of netcat such that it doesn't close the connection by default: Could you please try adding -q 0 so instead of netcat you use nc -q 0 in the batch script? If that doesn't help let me know and I will check it out in more detail.

shuangxia commented 6 years ago

Hi Sebastian thanks for getting back to me. Unfortunately that didn't work either. I've also tried something from the netcat cheatsheet on pushing file to listener port https://www.sans.org/security-resources/sec560/netcat_cheat_sheet_v1.pdf but that didn't work either. I setup the server on an AWS ec2 Linux instance. Do you have experience with this particular settings?

Thanks

shuangxia commented 6 years ago

I've tried to modify the test sample data by including only a few points, but I still get the same error:

TrackerServer: JSON request faulty or incomplete: {"format": "geojson", "request": [{"id": "x001", "time": 1410324847000, "point": "POINT (11.564388282625075 48.16350662940509)"}]} java.lang.RuntimeException: JSON request faulty or incomplete: {"format": "geojson", "request": [{"id": "x001", "time": 1410324847000, "point": "POINT (11.564388282625075 48.16350662940509)"}]}

can it be something with JSON parsing?

shuangxia commented 6 years ago

my fault, I was running the wrong server. nc localhost 1234 works for me now. I'll close the issue.