| Forum | GitHub | Maps | Blog

Issues setting up GTFS routing


My first time with GTFS routing, so no clue what I’m doing wrong. I use a GTFS file from this site and an Estonian OSM file. I tried to set up the routing according to instructions and got it to build properly, but when I try to set up the routing I get the following problem:

! at com.graphhopper.http.GraphHopperApplication.main(
    at com.graphhopper.reader.gtfs.GtfsStorage.loadGtfsFromFile(
    at com.graphhopper.reader.gtfs.GraphHopperGtfs.createOrLoad(
    at com.graphhopper.http.GraphHopperBundle.runPtGraphHopper(
    at com.graphhopper.http.GraphHopperApplication.main(
Caused by: java.lang.NullPointerException
    at com.conveyal.gtfs.GTFSFeed.<init>(
    at com.conveyal.gtfs.GTFSFeed.<init>(
    at com.graphhopper.reader.gtfs.GtfsStorage.loadGtfsFromFile(
    ... 10 more

How should I proceed? Is the file the problem?


Can you tell us the exact command you used to import this? And can you print the full logs - it seems that something is missing from the stacktrace, as it should show something like “Could not construct db from file”


I used these exact commands (of course pointing to my files) from the quick start:

I can check the full errors later.

Thanks for the quick response :blush:


of course pointing to my files

I meant those files :slight_smile:
To avoid other problems - put them in the current directory and avoid spaces.

Are you using GTFS and an openstreetmap file or just GTFS? Can you try with a different GTFS file too?


Ok. I have an OSM file too and the files are already in the working directory and I tried the following command

java -Xmx8g -Xms8g \

-jar web/target/graphhopper-web-*.jar server config.yml


Thanks - I can reproduce the issue (highly likely something strange in the data) and have created:


Thanks a lot! I’ll check if I can hack my way with the data before it gets fixed.


Yeah, I looked at that file, and agency.txt exists, but is empty.
That’s illegal per the GTFS spec, which requires at least one agency.
Adding a dummy data row to agency.txt with the required fields should fix it.