graphhopper:# OSM data file for Chandigarhdatareader.file: ./chandigarh-latest.osm.pbfimport.osm.ignored_highways:# Location where GraphHopper will store the processed graph datagraph.location: ./graph-cache# Vehicle profiles with multiple custom models for user choiceprofiles:# Balanced routing - good default for most users- name: car_balancedprofile: carweighting: customcustom_model_files: ["chandigarh_balanced.json"]# Fast routing - prioritizes speed and main roads- name: car_fastprofile: carweighting: customcustom_model_files: ["chandigarh_fast.json"]# Traffic avoidance - uses smaller roads to avoid congestion- name: car_avoid_trafficprofile: carweighting: customcustom_model_files: ["chandigarh_avoid_traffic.json"]# Standard car profile (fallback without custom model)- name: car_standardprofile: carweighting: fastest# Walking profile for pedestrian navigation- name: footprofile: footweighting: fastest# Cycling profile- name: bikeprofile: bikeweighting: fastest# Enable Contraction Hierarchies for faster queriesprofiles_ch:- profile: car_fast- profile: car_avoid_traffic- profile: car_standard- profile: bike# Simple server configuration for local developmentserver:application_connectors:- type: httpport: 8989bind_host: localhost # Only accessible locally- type: httpport: 8990bind_host: localhost# Memory settings for local machinegraph.dataaccess.default_type: RAM_STORE# Simple logging for developmentlogging:level: INFOappenders:- type: consoleheres my
this is my yaml file, i want to load the custom models which are in the same directory as the yaml file
this error is popping up:
ERROR [2025-09-03 13:09:47,952] io.dropwizard.core.cli.ServerCommand: Unable to start server, shutting down
! java.lang.NullPointerException: Cannot invoke “com.graphhopper.util.CustomModel.getPriority()” because “model” is null
! at com.graphhopper.routing.weighting.custom.CustomModelParser.findVariablesForEncodedValuesString(CustomModelParser.java:191)
In case anyone needs the full error output:
(safety_venv) PS D:\Safety Route\graphhopper> java -jar graphhopper-web.jar server config.yaml
INFO [2025-09-03 13:09:47,497] io.dropwizard.core.server.DefaultServerFactory: Registering jersey handler with root path prefix: /
INFO [2025-09-03 13:09:47,500] io.dropwizard.core.server.DefaultServerFactory: Registering admin handler with root path prefix: /
INFO [2025-09-03 13:09:47,735] io.dropwizard.assets.AssetsBundle: Registering AssetBundle with name: assets for path /maps/*
INFO [2025-09-03 13:09:47,738] io.dropwizard.assets.AssetsBundle: Registering AssetBundle with name: webjars for path /webjars/*
INFO [2025-09-03 13:09:47,744] io.dropwizard.core.server.ServerFactory: Starting GraphHopperApplication
_ _
__ _ _ __ __ _ _ __ | |__ | |__ ___ _ __ _ __ ___ _ __
/| '__/ _ | ’| '_ | '_ \ / _ | '_ | '_ \ / _ \ '|
| (| | | | (| | |) | | | | | | | () | |) | |) | / |
_, || _,| ./|| ||| ||_/| ./| ./ _||
|/ || || |_|
INFO [2025-09-03 13:09:47,879] org.eclipse.jetty.setuid.SetUIDListener: Opened application@7ea08277{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
INFO [2025-09-03 13:09:47,879] org.eclipse.jetty.setuid.SetUIDListener: Opened admin@6401d0a0{HTTP/1.1, (http/1.1)}{0.0.0.0:8081}
INFO [2025-09-03 13:09:47,881] org.eclipse.jetty.server.Server: jetty-10.0.23; built: 2024-08-14T01:14:42.815Z; git: 570aa4a1395ca8f9f800045f3a1fe5fe3af9a598; jvm 24.0.2+12-54
INFO [2025-09-03 13:09:47,899] com.graphhopper.GraphHopper: version 10.2|2025-01-20T08:40:08Z (9,23,7,5,2,9)
ERROR [2025-09-03 13:09:47,952] io.dropwizard.core.cli.ServerCommand: Unable to start server, shutting down
! java.lang.NullPointerException: Cannot invoke “com.graphhopper.util.CustomModel.getPriority()” because “model” is null
! at com.graphhopper.routing.weighting.custom.CustomModelParser.findVariablesForEncodedValuesString(CustomModelParser.java:191)
! at com.graphhopper.GraphHopper.lambda$prepareImport$18(GraphHopper.java:843)
! at java.base/java.util.LinkedHashMap$LinkedValues.forEach(LinkedHashMap.java:834)
! at com.graphhopper.GraphHopper.prepareImport(GraphHopper.java:843)
! at com.graphhopper.GraphHopper.process(GraphHopper.java:799)
! at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:774)
! at com.graphhopper.http.GraphHopperManaged.start(GraphHopperManaged.java:44)
! at io.dropwizard.lifecycle.JettyManaged.doStart(JettyManaged.java:27)
! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
! at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:171)
! at org.eclipse.jetty.server.Server.start(Server.java:470)
! at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:121)
! at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:89)
! at org.eclipse.jetty.server.Server.doStart(Server.java:415)
! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
! at io.dropwizard.core.cli.ServerCommand.run(ServerCommand.java:52)
! at io.dropwizard.core.cli.EnvironmentCommand.run(EnvironmentCommand.java:67)
! at io.dropwizard.core.cli.ConfiguredCommand.run(ConfiguredCommand.java:98)
! at io.dropwizard.core.cli.Cli.run(Cli.java:78)
! at io.dropwizard.core.Application.run(Application.java:94)
! at com.graphhopper.application.GraphHopperApplication.main(GraphHopperApplication.java:38)
INFO [2025-09-03 13:09:47,954] org.eclipse.jetty.server.Server: Stopped Server@7bc6d27a{STOPPING}[10.0.23,sto=30000]
INFO [2025-09-03 13:09:47,954] org.eclipse.jetty.server.Server: Shutdown Server@7bc6d27a{STOPPING}[10.0.23,sto=30000]
WARN [2025-09-03 13:09:47,960] io.dropwizard.core.cli.ServerCommand: Failure during stop server
! java.lang.IllegalStateException: STOPPED
! at org.eclipse.jetty.server.handler.ContextHandler.shutdown(ContextHandler.java:773)
! at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:215)
! at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1716)
! at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:570)
! at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
! at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:636)
! at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:291)
! at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:656)
! at org.eclipse.jetty.util.component.Graceful.shutdown(Graceful.java:146)
! … 8 common frames omitted
! Causing: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: STOPPED
! at java.base/java.util.concurrent.CompletableFuture.wrapInExecutionException(CompletableFuture.java:347)
! at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:442)
! at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2142)
! at org.eclipse.jetty.server.Server.doStop(Server.java:490)
! at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:132)
! at io.dropwizard.core.cli.ServerCommand.run(ServerCommand.java:56)
! at io.dropwizard.core.cli.EnvironmentCommand.run(EnvironmentCommand.java:67)
! at io.dropwizard.core.cli.ConfiguredCommand.run(ConfiguredCommand.java:98)
! at io.dropwizard.core.cli.Cli.run(Cli.java:78)
! at io.dropwizard.core.Application.run(Application.java:94)
! at com.graphhopper.application.GraphHopperApplication.main(GraphHopperApplication.java:38)
java.lang.NullPointerException: Cannot invoke “com.graphhopper.util.CustomModel.getPriority()” because “model” is null
at com.graphhopper.routing.weighting.custom.CustomModelParser.findVariablesForEncodedValuesString(CustomModelParser.java:191)
at com.graphhopper.GraphHopper.lambda$prepareImport$18(GraphHopper.java:843)
at java.base/java.util.LinkedHashMap$LinkedValues.forEach(LinkedHashMap.java:834)
at com.graphhopper.GraphHopper.prepareImport(GraphHopper.java:843)
at com.graphhopper.GraphHopper.process(GraphHopper.java:799)
at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:774)
at com.graphhopper.http.GraphHopperManaged.start(GraphHopperManaged.java:44)
at io.dropwizard.lifecycle.JettyManaged.doStart(JettyManaged.java:27)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:171)
at org.eclipse.jetty.server.Server.start(Server.java:470)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:121)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:89)
at org.eclipse.jetty.server.Server.doStart(Server.java:415)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
at io.dropwizard.core.cli.ServerCommand.run(ServerCommand.java:52)
at io.dropwizard.core.cli.EnvironmentCommand.run(EnvironmentCommand.java:67)
at io.dropwizard.core.cli.ConfiguredCommand.run(ConfiguredCommand.java:98)
at io.dropwizard.core.cli.Cli.run(Cli.java:78)
at io.dropwizard.core.Application.run(Application.java:94)
at com.graphhopper.application.GraphHopperApplication.main(GraphHopperApplication.java:38)