I am working on route optimization using google or-tools with java. Everything works fine until I change the thread. This works fine when I'm doing everything in one Thread. I call routing.solveWithParameters(searchParameters) in a new thread. And then, in another thread, when I call routing.getArcCostForVehicle(prevIndex, index, vehicleIndex) , I get an error (it cannot find values in memory).
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j com.google.ortools.constraintsolver.mainJNI.RoutingModel_getArcCostForVehicle(JLcom/google/ortools/constraintsolver/RoutingModel;JJJ)J+0
j com.google.ortools.constraintsolver.RoutingModel.getArcCostForVehicle(JJJ)J+9