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

help about TrackerServer: update failed: null java.lang.NullPointerException #99

Closed eskuai closed 6 years ago

eskuai commented 6 years ago

Hello,

I am trying to run barefoot, using your quickstarts, and i always get the same error:

TrackerServer: update failed: null java.lang.NullPointerException

What i do.

Launcher docker

[ec2-user@barefoot]$ docker run -it -p 5432:5432 --name="barefoot-oberbayern" -v ${PWD}/map/:/mnt/map barefoot-map

[ec2-user@barefoot]$ java -jar target/barefoot-0.1.4-tracker-jar-with-dependencies.jar config/tracker.properties config/oberbayern.properties

[ec2-user@barefoot]$ python util/submit/stream.py --host localhost --port 1234 --file src/test/resources/com/bmwcarit/barefoot/matcher/x0001-001.json

[ec2-user@barefoot]node util/monitor/monitor.js 3000 127.0.0.1 1235

[ec2-user@barefoot]nc -l -p 9595 -c "nc 127.0.0.1 3000"

then, when i browsed using firefox to 9595 show maps , but .. no changes ... and get error

[ec2-user@ barefoot]$ java -jar target/barefoot-0.1.4-tracker-jar-with-dependencies.jar config/tracker.properties config/oberbayern.properties 2018-03-20 13:58:39,595 INFO [main] TrackerControl: initialize server 2018-03-20 13:58:39,598 INFO [main] TrackerControl: read database properties from file config/oberbayern.properties 2018-03-20 13:58:39,600 INFO [main] Loader: load map from file /data01/barefoot/oberbayern.bfmap 2018-03-20 13:58:39,669 INFO [main] RoadMap: inserting roads ... 2018-03-20 13:58:39,669 INFO [main] RoadMap: inserted 0 (0) roads and finished 2018-03-20 13:58:39,685 INFO [main] RoadMap: ~0 megabytes used for road data (estimate) 2018-03-20 13:58:39,696 INFO [main] RoadMap: index and topology constructing ... 2018-03-20 13:58:39,705 INFO [main] RoadMap: index and topology constructed 2018-03-20 13:58:39,719 INFO [main] RoadMap: ~0 megabytes used for spatial index (estimate) 2018-03-20 13:58:39,719 INFO [main] TrackerControl: read tracker properties from file config/tracker.properties 2018-03-20 13:58:39,769 INFO [main] TrackerServer: tracker.state.ttl=60 2018-03-20 13:58:39,769 INFO [main] TrackerServer: tracker.port=1235 2018-03-20 13:58:39,769 INFO [main] TrackerServer: tracker.monitor.sensitive=0.0 2018-03-20 13:58:39,780 INFO [main] TrackerServer: matcher.radius.max=200.0 2018-03-20 13:58:39,781 INFO [main] TrackerServer: matcher.distance.max=5000.0 2018-03-20 13:58:39,781 INFO [main] TrackerServer: matcher.lambda=0.0 2018-03-20 13:58:39,781 INFO [main] TrackerServer: matcher.sigma=5.0 2018-03-20 13:58:39,781 INFO [main] TrackerServer: matcher.threads=8 2018-03-20 13:58:39,781 INFO [main] TrackerServer: matcher.interval.min=1000 2018-03-20 13:58:39,781 INFO [main] TrackerServer: matcher.distance.min=0.0 2018-03-20 13:58:39,781 INFO [main] AbstractServer: server.port=1234 2018-03-20 13:58:39,781 INFO [main] AbstractServer: server.timeout.request=1000 2018-03-20 13:58:39,781 INFO [main] AbstractServer: server.timeout.response=10000 2018-03-20 13:58:39,781 INFO [main] AbstractServer: server.connections=100 2018-03-20 13:58:39,782 INFO [main] TrackerControl: starting server on port 1234 with map oberbayern 2018-03-20 13:58:39,782 INFO [main] AbstractServer: listening on port 1234 ... 2018-03-20 13:58:58,671 INFO [Thread-18] Filter: HMM break - no state emissions 2018-03-20 13:58:58,672 ERROR [pool-2-thread-2] TrackerServer: update failed: null java.lang.NullPointerException at com.bmwcarit.barefoot.matcher.MatcherKState.toMonitorJSON(MatcherKState.java:179) at com.bmwcarit.barefoot.tracker.TrackerServer$StatePublisher.publish(TrackerServer.java:296) at com.bmwcarit.barefoot.tracker.TrackerServer$StatePublisher.publish(TrackerServer.java:267) at com.bmwcarit.barefoot.tracker.TemporaryMemory$TemporaryElement.updateAndUnlock(TemporaryMemory.java:110) at com.bmwcarit.barefoot.tracker.TrackerServer$MatcherResponseFactory$2.response(TrackerServer.java:221) at com.bmwcarit.barefoot.util.AbstractServer$ResponseHandler.call(AbstractServer.java:143) at com.bmwcarit.barefoot.util.AbstractServer$ResponseHandler.call(AbstractServer.java:119) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) 2018-03-20 13:58:59,684 INFO [Thread-14] Filter: HMM break - no state emissions

TX

smattheis commented 6 years ago

Have you imported some data into your map server? That means, have you run the bash /mnt/map/osm/import.sh after docker run -it -p 5432:5432 --name="barefoot-oberbayern" -v ${PWD}/map/:/mnt/map barefoot-map as shown in step 5 of https://github.com/bmwcarit/barefoot#map-server? Further, have you waited until the import completed? Note, the log that you posted says you loaded 0 roads which sounds like exactly that. (After you imported some data into the database, you should delete the bfmap file that has been created because it's usually just a compact copy of the data which, however, is very likely corrupted/empty in your case.) Also, I suggest to start the monitor before you start the submit script.

eskuai commented 6 years ago

Thank you

0 roads was very strange.

I've started again .. watch out ... removing all files from directory ...

[ec2-user@barefoot]$ git clone https://github.com/bmwcarit/barefoot.git Cloning into 'barefoot'... remote: Counting objects: 2777, done. remote: Compressing objects: 100% (14/14), done. remote: Total 2777 (delta 12), reused 16 (delta 7), pack-reused 2756 Receiving objects: 100% (2777/2777), 37.66 MiB | 21.28 MiB/s, done. Resolving deltas: 100% (1930/1930), done. [ec2-user@ip-172-31-42-99 barefoot]$ wget http://download.geofabrik.de/europe/germany/bayern/oberbayern-latest.osm.pbf -o map/osm/oberbayern.osm.pbf [ec2-user@ip-172-31-42-99 barefoot]$

316707 segments from 220000 ways inserted. 325147 segments from 230000 ways inserted. 333519 segments from 240000 ways inserted. 342294 segments from 250000 ways inserted. 351067 segments from 260000 ways inserted. 359082 segments from 270000 ways inserted. 366643 segments from 280000 ways inserted. 377379 segments from 290000 ways inserted. 394787 segments from 300000 ways inserted. 409427 segments from 310000 ways inserted. 419706 segments from 320000 ways inserted. 429394 segments from 330000 ways inserted. 438263 segments from 340000 ways inserted. 447708 segments from 350000 ways inserted. 458092 segments from 360000 ways inserted. 468032 segments from 370000 ways inserted. 476035 segments from 380000 ways inserted. 485504 segments from 390000 ways inserted. 492629 segments from 400000 ways inserted. 498923 segments from 410000 ways inserted. 506529 segments from 420000 ways inserted. 514700 segments from 430000 ways inserted. 523557 segments from 440000 ways inserted. 531116 segments from 450000 ways inserted. 539137 segments from 460000 ways inserted. 547070 segments from 470000 ways inserted. 555068 segments from 480000 ways inserted. 561938 segments from 490000 ways inserted. 569305 segments from 500000 ways inserted. 576147 segments from 510000 ways inserted. 582569 segments from 520000 ways inserted. 589493 segments from 530000 ways inserted. 595966 segments from 540000 ways inserted. 601952 segments from 550000 ways inserted. 608621 segments from 560000 ways inserted. 615724 segments from 570000 ways inserted. 623940 segments from 580000 ways inserted. 631535 segments from 590000 ways inserted. 641049 segments from 600000 ways inserted. 645517 segments from 604988 ways inserted. 645517 segments from 604988 ways inserted and finished. Done. Done. root@6e3803de990d:/#

ok ... finished process .. same problem ... now reading roads ok then, searching for oberbayern.bfmap file from /barefoot is a 5 byte files ... i renamed it --> oberbayern.bfmapjsa start agin ... and ok ... ec2-user@ip-172-31-42-99 barefoot]$ java -jar target/barefoot-0.1.4-tracker-jar-with-dependencies.jar config/tracker.properties config/oberbayern.properties 2018-03-21 10:35:40,816 INFO [main] TrackerControl: initialize server 2018-03-21 10:35:40,818 INFO [main] TrackerControl: read database properties from file config/oberbayern.properties 2018-03-21 10:35:40,821 INFO [main] Loader: load map from file /data01/barefoot/oberbayern.bfmap 2018-03-21 10:35:40,890 INFO [main] RoadMap: inserting roads ... 2018-03-21 10:35:41,565 INFO [main] RoadMap: inserted 100000 (192798) roads 2018-03-21 10:35:42,194 INFO [main] RoadMap: inserted 200000 (388075) roads 2018-03-21 10:35:42,861 INFO [main] RoadMap: inserted 300000 (583148) roads 2018-03-21 10:35:43,457 INFO [main] RoadMap: inserted 400000 (775527) roads 2018-03-21 10:35:44,133 INFO [main] RoadMap: inserted 500000 (968691) roads 2018-03-21 10:35:44,724 INFO [main] RoadMap: inserted 600000 (1157796) roads 2018-03-21 10:35:44,993 INFO [main] RoadMap: inserted 645517 (1246735) roads and finished 2018-03-21 10:35:45,983 INFO [main] RoadMap: ~235 megabytes used for road data (estimate) 2018-03-21 10:35:46,454 INFO [main] RoadMap: index and topology constructing ... 2018-03-21 10:35:49,823 INFO [main] RoadMap: index and topology constructed 2018-03-21 10:35:50,680 INFO [main] RoadMap: ~95 megabytes used for spatial index (estimate) 2018-03-21 10:35:50,680 INFO [main] TrackerControl: read tracker properties from file config/tracker.properties port:=1235 2018-03-21 10:35:50,727 INFO [main] TrackerServer: tracker.state.ttl=60 2018-03-21 10:35:50,727 INFO [main] TrackerServer: tracker.port=1235 2018-03-21 10:35:50,727 INFO [main] TrackerServer: tracker.monitor.sensitive=0.0 2018-03-21 10:35:50,744 INFO [main] TrackerServer: matcher.radius.max=200.0 2018-03-21 10:35:50,744 INFO [main] TrackerServer: matcher.distance.max=5000.0 2018-03-21 10:35:50,744 INFO [main] TrackerServer: matcher.lambda=0.0 2018-03-21 10:35:50,744 INFO [main] TrackerServer: matcher.sigma=5.0 2018-03-21 10:35:50,744 INFO [main] TrackerServer: matcher.threads=8 2018-03-21 10:35:50,744 INFO [main] TrackerServer: matcher.interval.min=1000 2018-03-21 10:35:50,744 INFO [main] TrackerServer: matcher.distance.min=0.0 2018-03-21 10:35:50,744 INFO [main] AbstractServer: server.port=1234 2018-03-21 10:35:50,745 INFO [main] AbstractServer: server.timeout.request=1000 2018-03-21 10:35:50,745 INFO [main] AbstractServer: server.timeout.response=10000 2018-03-21 10:35:50,745 INFO [main] AbstractServer: server.connections=100 2018-03-21 10:35:50,745 INFO [main] TrackerControl: starting server on port 1234 with map oberbayern 2018-03-21 10:35:50,745 INFO [main] AbstractServer: listening on port 1234 ... json{} ok, solution is always remove this file after end installation process Thx
eskuai commented 6 years ago

thank you, remove file after end installation process

smattheis commented 6 years ago

Normally, you don't need to remove any file. It's only because, you initially had a corrupted bfmap file. However, if you mean "after each new import you need to remove the bfmap file", yes that's correct to read the new map data it's necessary to remove the bfmap because it's used as a buffer for faster start-up of the matcher.