[OTP 0.13] [Isochrones] java.lang.NullPointerException null

171 views
Skip to first unread message

Karimou Ba

unread,
Mar 3, 2015, 10:09:56 PM3/3/15
to opentripp...@googlegroups.com
Hello,

I am trying to use OTP (version 0.13) to get some isochrones but I keep on receiving the above message: java.lang.NullPointerException. 

Reading the error logs it seems that the issue is coming from line 189 in the class org.opentripplanner.api.resource.Lisochrone (inside the computeIsochrone function) =>
"isochrones = otpServer.isoChroneSPTRenderer.getIsochrones(isoChroneRequest, sptRequest);" 

I am still really new to OTP (and Java...) so the issue is maybe obvious...apologies if so...

Has anyone ever encounter similar issue with Isochrones?

Cheers

Karimou

Laurent Grégoire

unread,
Mar 4, 2015, 3:38:55 AM3/4/15
to Karimou Ba, opentripp...@googlegroups.com
Hi Karimou,

On Tue, 3 Mar 2015 14:18:16 -0800 (PST)
Karimou Ba <karim...@gmail.com> wrote:
> Reading the error logs it seems that the issue is coming from line
> 189 in the class org.opentripplanner.api.resource.Lisochrone (inside
> the computeIsochrone function) =>
> "isochrones =
> otpServer.isoChroneSPTRenderer.getIsochrones(isoChroneRequest,
> sptRequest);"

It's a known issue, caused by the change in the way we inject dependent
services. It has been solved in master in commit 90c898a6:
https://github.com/opentripplanner/OpenTripPlanner/commit/90c898a6a066c87bac64eeefb1a97ac7a288eabe

Attached is a patch backported to 0.13, also seen here:
https://github.com/laurentg/OpenTripPlanner-plannerstack/commit/e1b028ba38dcbdab48cdb9c41f4c141a195b06bf

HTH,

--Laurent
0001-Backport-isochrone-DI-fix-on-0.13-branch.patch

Laurent Grégoire

unread,
Mar 4, 2015, 3:44:41 AM3/4/15
to Karimou Ba, opentripp...@googlegroups.com
On Wed, 4 Mar 2015 09:38:01 +0100
Laurent Grégoire <laurent....@gmail.com> wrote:
> Attached is a patch backported to 0.13, also seen here:
> https://github.com/laurentg/OpenTripPlanner-plannerstack/commit/e1b028ba38dcbdab48cdb9c41f4c141a195b06bf

Also available on the master repo in the 0.13.x fix branch:
https://github.com/opentripplanner/OpenTripPlanner/commit/e1b028ba38dcbdab48cdb9c41f4c141a195b06bf

--Laurent

Vincent Dionne

unread,
Mar 25, 2015, 11:34:38 AM3/25/15
to opentripp...@googlegroups.com, karim...@gmail.com
Hi Laurent,

is it possible to apply that path to the master (1.0.0.SNAPSHOT)?     Andrew suggested us to use the most recent version to fix some itinerary problems (link below),  but the isochrone are no longer working.    It seems that the patch has not been apply to the master.

Can it be fixed?

https://groups.google.com/forum/#!topic/opentripplanner-dev/aFy_vqpxztk

thank you!

Laurent GRÉGOIRE

unread,
Mar 25, 2015, 11:47:13 AM3/25/15
to Vincent Dionne, opentripplanner-dev, karim...@gmail.com
Hi Vincent,

On 25 March 2015 at 16:34, 'Vincent Dionne' via OpenTripPlanner
Developers <opentripp...@googlegroups.com> wrote:
> is it possible to apply that path to the master (1.0.0.SNAPSHOT)? Andrew
> suggested us to use the most recent version to fix some itinerary problems
> (link below), but the isochrone are no longer working. It seems that the
> patch has not been apply to the master.

This patch is a backport *from* master, so it should be definitively on master.

But what in the isochrone is not working exactly?

--Laurent

Vincent Dionne

unread,
Mar 25, 2015, 12:16:00 PM3/25/15
to opentripp...@googlegroups.com, nfv...@yahoo.ca, karim...@gmail.com

Ok, we are currently running many version at the same time trying to sort things out and we got confused a liitle bit. 

1- I was wrong about the patch, it is ok on master.

2- We finally figure out that what did change  between 0.13  and master is the isochrone format.

Using that local URL :

http://132.207.98.170:8014/otp/routers/default/isochrone?fromPlace=45.537854,-73.611638&date=2015/03/20&time=11:00:00&maxWalkDistance=500&mode=WALK,TRANSIT&cutoffSec=300&cutoffSec=600&cutoffSec=900&cutoffSec=1200&cutoffSec=1500&cutoffSec=1800&cutoffSec=2100&cutoffSec=2400&cutoffSec=2700&cutoffSec=3000&cutoffSec=3300&cutoffSec=3600

In 0.13 =>  GeoJSON is returned  => it's what our program is expecting
master => zip file is returned (shp) => our program crash.

Is there a way to force a GeoJSON format?

thank you!

Laurent GRÉGOIRE

unread,
Mar 25, 2015, 1:30:23 PM3/25/15
to Vincent Dionne, opentripplanner-dev, karim...@gmail.com
On 25 March 2015 at 17:16, 'Vincent Dionne' via OpenTripPlanner
Developers <opentripp...@googlegroups.com> wrote:
> Is there a way to force a GeoJSON format?

Sure! You set your "Accept" HTTP header to "application/json". Using
curl for example:

curl --header "Accept: application/json"
"http://a.b.c.d/otp/routers/default/isochrone?..."

HTH,

--Laurent

Vincent Dionne

unread,
Mar 25, 2015, 4:23:21 PM3/25/15
to opentripp...@googlegroups.com

Thank you for the fast answer !  it's working fine now!

Vincent
Reply all
Reply to author
Forward
0 new messages