"no graph registered with the routerId"

235 views
Skip to first unread message

Stephan Lehmler

unread,
Jun 12, 2018, 5:23:18 AM6/12/18
to OpenTripPlanner Users
Hello,

I am a first time user of OTP and want to use it to get travel times for a set of centroids.
As I cannot use the scripting API (it seems to depend on Jython, which only supports Python2 & my code is using Python3), my current plan is to run otp on localhost and use the web API for queries.


I managed to build the graph.obj for my area of interest:
 'java -jar otp/otp-1.2.0-shaded.jar --build otp/graphs/strasbourg'

And started the Grizzly server :
java -Xmx8G -jar otp-1.2.0-shaded.jar --router strasbourg --server --port 8813 --securePort 8814

But as soon as I try to enter any query, f.e. the one given in the intermediate tutorial, I land on a site saying:
"java.lang.NullPointerException null".


During the start-up of the server, I got some warnings regarding the routerID :
10:59:23.144 INFO (GraphService.java:189) Registering new router 'strasbourg'
10:59:23.144 WARN (InputStreamGraphSource.java:218) Graph file not found or not openable for routerId 'strasbourg': java.io.FileNotFoundException: \var\otp\graphs\strasbourg\Graph.obj (Das System kann die angegebene Datei nicht finden)
10:59:23.144 WARN (InputStreamGraphSource.java:144) Unable to load data for router 'strasbourg'.
10:59:23.144 WARN (GraphService.java:198) Can't register router ID 'strasbourg', no graph.

This obviously is the cause of the error.

What I want to ask is how to enable otp to register the routerID? Why can't otp find my Graph file?
My folder is structured like this:
.../otp/
        - otp-1.2.0-shaded.jar
        -graphs/
             -strasbourg/
                    -Graph.obj
                    -strasbourg.osm.pbf
                    -gtfs.zip

Benhlima Ouidad

unread,
Feb 17, 2022, 12:31:31 PM2/17/22
to OpenTripPlanner Users
Hi, did u manage to resolve it ? I am facing the same issue 

Andrew Byrd

unread,
Feb 21, 2022, 3:03:51 AM2/21/22
to Benhlima Ouidad, OpenTripPlanner Users
Hello,

The key error here is:
10:59:23.144 WARN (InputStreamGraphSource.java:218) Graph file not found or not openable for routerId 'strasbourg': java.io.FileNotFoundException: \var\otp\graphs\strasbourg\Graph.obj (Das System kann die angegebene Datei nicht finden)

Note the file path where OTP is looking for the graph. To quote from the documentation: "The OTP base directory defaults to /var/otp. Unless you tell OTP otherwise, all other configuration, input files and storage directories will be sought immediately beneath this one.” You will need to add a --basePath switch to your command to set your own base directory. The relevant documentation is at: http://docs.opentripplanner.org/en/v1.5.0/Configuration/#base-directory 

The tricky bit here is that the --build option can take any relative or absolute path as an argument independent of the basePath, but the --router option's parameter resolves to the directory [basePath]/graphs/[routerId].

Also note that this information is specific to OTP 1.x which allows multiple routers per instance, and does not apply to OTP2 which supports only a single router per instance.

-Andrew

--
You received this message because you are subscribed to the Google Groups "OpenTripPlanner Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opentripplanner-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/opentripplanner-users/2e7cefc3-455e-463b-a899-a7c656f8adb0n%40googlegroups.com.

Benhlima Ouidad

unread,
Feb 21, 2022, 7:20:24 PM2/21/22
to Andrew Byrd, OpenTripPlanner Users
Yes, Thank you ! 



Mailtrack Sender notified by
Mailtrack
22/02/22, 01:19:55

Reply all
Reply to author
Forward
0 new messages