maven - File lock exception when using graphHopper in java program -
i'm using graphhopper in following way:
graphhopper hopper = new graphhopper().forserver(); hopper.setchenable(false); hopper.setgraphhopperlocation(graphhopermasterfile); hopper.setosmfile(osmfile); hopper.setencodingmanager(new encodingmanager("car,bike")); hopper.importorload(); ghrequest req = new ghrequest().addpoint(new ghpoint (latfrom, lonfrom)).addpoint(new ghpoint(latto, lonto)) .setvehicle("car") .setweighting("fastest") .setalgorithm(algorithmoptions.astar_bi);; req.gethints().put("pass_through", true); ghresponse res = hopper.route(req);
i obtained graphhopermasterfile downloading zip https://github.com/graphhopper/graphhopper/blob/0.5/docs/core/routing.md.
i obtained .osm file http://download.geofabrik.de/europe/great-britain/england/greater-london.html.
i added maven dependancy http://mvnrepository.com/artifact/com.graphhopper/graphhopper-web/0.5.0. sense it's wrong have maven dependancy , reference graphhopperlocation, i'm not sure.
when run code sometime (not time) following errors:
java.util.concurrent.executionexception: java.lang.runtimeexception: avoid reading partial data need obtain read lock failed. caused by: java.lang.runtimeexception: avoid reading partial data need obtain read lock failed. caused by: java.nio.channels.overlappingfilelockexception
when works following:
2016-01-28 08:48:14,551 [pool-1-thread-8] info com.graphhopper.graphhopper - version 0.5.0|2015-08-12t12:33:51+0000 (4,12,3,2,2,1) 2016-01-28 08:48:14,551 [pool-1-thread-8] info com.graphhopper.graphhopper - graph car,bike|ram_store|2d|noext|4,12,3,2,2, details:edges:387 339(12mb), nodes:291 068(4mb), name:(2mb), geo:960 828(4mb), bounds:-0.5177850019436703,0.33744369456418666,51.28324388600686,51.69833101402963
i see thrown error on here https://github.com/graphhopper/graphhopper/blob/master/core/src/main/java/com/graphhopper/graphhopper.java
how can stop error happening?
Comments
Post a Comment