Skip to content

faq 109129786

Billy Charlton edited this page Sep 5, 2018 · 2 revisions

Error injecting Transit Router

by Renan Grace on 2017-04-28 08:06:22


Hi all,

I have built a test case for transit that works well. However, when I transfer the same config settings to my main model (with larger and more complex input files), I get the following error:

Exception in thread "main" com.google.inject.ProvisionException: Unable to provision, see the following errors:
 1) Error injecting constructor, java.lang.NullPointerException
 at org.matsim.pt.router.TransitRouterImplFactory.<init>(TransitRouterImplFactory.java:42)
 at org.matsim.pt.router.TransitRouterImplFactory.class(TransitRouterImplFactory.java:33)
 while locating org.matsim.pt.router.TransitRouterImplFactory
 while locating org.matsim.pt.router.TransitRouter
 for parameter 0 at org.matsim.core.router.Transit.<init>(Transit.java:20)
 while locating org.matsim.core.router.Transit
 while locating org.matsim.core.router.RoutingModule annotated with @com.google.inject.name.Named(value=train)
 while locating org.matsim.core.router.RoutingModule annotated with @com.google.inject.multibindings.Element(setName=,uniqueId=124, type=MAPBINDER, keyType=java.lang.String)
 at org.matsim.core.router.TripRouter.<init>(TripRouter.java:66)
 while locating org.matsim.core.router.TripRouter

This appears to be a config issue, but I'm quite stumped by it as the same  set of transit config inputs seems to work fine on my test inputs.

Any advice would be greatly appreciated.

Renan.


Comments: 1


Re: Error injecting Transit Router

by Renan Grace on 2017-05-09 12:04:26

Hi Amit, thanks for the response. I tried a few things with my PT inputs and config settings and managed to get it to work. However I can't remember (or never knew) exactly what was causing the problem or which change ended up solving it.

I think at the core of my difficulties was that I was assigning individuals to "bus, car and tram" as modes, instead of "pt". When I changed that I got on the right track.

Clone this wiki locally