Re: [OpenTripPlanner] How to run OTP for the first time in IntelliJ IDEA

1,243 views
Skip to first unread message
Message has been deleted

Marko Burjek

unread,
Feb 26, 2015, 4:43:27 AM2/26/15
to OpenTripPlanner Developers
Hello!

Here you can see how to specify arguments to main class in intellij: https://www.jetbrains.com/idea/help/setting-configuration-options.html

Which programs options to use you can see here: https://github.com/opentripplanner/OpenTripPlanner/wiki/Minimal-Introduction

Instead of running otp.jar from command line just add them to program parameters.

You will probably need two run configurations. One for building graph with parameters:
--build path to directory with OSM/GTFS
And one for running OTP (--graphs path to directory with graph[usually the same as OSM/GTFS since by default graph is build there] --server)

2015-02-26 9:02 GMT+01:00 Mohammad Haqqani <mohammad...@gmail.com>:
Hi guys,

I am NOT a software developer and here is probably not a right place to ask this question and I've tried my best not to, but I couldn't figure it out by myself.

I am trying to run OTP in intelliJ on a windows 7 platform and I have downloaded the GTFS and openStreetMap data as well. however I don't know how to pass the parameters to the main class (which I think is the parameters should be the address of these files and also something for JVM configuration). I almost read the all the documents in opentripplanner.org but most of them was about running this on a linux machine using otp.jar file which is not my case. By the way I found this article as well but unfortunately it doesn't answer my question either.


this is the part of document that I don't know how to do: " your main class will be org.opentripplanner.standalone.OTPMain, and you may want to specify VM options to increase the JVM heap size (e.g. -Xmx4G to increase the limit to 4GB). Only the "Program arguments" will be different for building and serving a graph (see "Standalone Graph Build" [article to be completed])."

Any help would be appreciated.

Kind Regards,
Mohammad


--
You received this message because you are subscribed to the Google Groups "OpenTripPlanner Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opentripplanner...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

andrew byrd

unread,
Feb 26, 2015, 6:35:26 AM2/26/15
to opentripp...@googlegroups.com
Hello,

I'd say this is a good place to ask since you want to get started coding
with OTP.

Just to let you know, I'm in the process of migrating all the
documentation to Readthedocs and rewriting it page by page. This new
documentation is available at docs.opentrippplanner.org (if it still
redirects you to Github you need to clear your browser cache). I would
avoid following the old wiki pages as much as possible. If there is any
basic information that is absent just let us know and I'll add it to the
new documentation so everyone will see it.

The basic introductory page is now
http://docs.opentripplanner.org/en/latest/Basic-Usage/ but
This page is written in terms of running a JAR. The JAR automatically
knows which main class to run, but when you are in an IDE you must
specify which main class you want to run when creating a run
configuration.

From there, everything is exactly the same as using the JAR. You can
specify command line parameters (--build, --inMemory, etc.) or JVM
parameters (like -Xmx2G) in the run configuration.

If your input files are small enough, you don't really even need two
steps (build and serve). You can just do what's shown in the tutorial
and use both the --build --inMemory switches to build a graph and use it
immediately without saving to disk.

-Andrew
> > the limit to 4GB). *Only the "Program arguments" will be different for
> > building and serving a graph (see "Standalone Graph Build" [article to be
> > completed])*."

andrew byrd

unread,
Feb 26, 2015, 6:39:53 AM2/26/15
to opentripp...@googlegroups.com
On Thu, Feb 26, 2015, at 12:35, andrew byrd wrote:
> This new
> documentation is available at docs.opentrippplanner.org (if it still
> redirects you to Github you need to clear your browser cache).

There seems to be something awry with applying the custom
docs.opentripplanner.org domain. If you encounter any "missing pages"
you can always use opentripplanner.readthedocs.org, which doesn't have
the same problems at least for me.

-Andrew
Message has been deleted

andrew byrd

unread,
Mar 2, 2015, 5:18:27 AM3/2/15
to opentripp...@googlegroups.com
On Mon, Mar 2, 2015, at 07:23, Mohammad Haqqani wrote:
> Thank you for your prompt response. I can build the graph right now but
> when I want to run OTP on server it gives me "GraphNotFoundException"
> error. I do have the "Graph.obj" and I pass "--graphs d:\OTP/Sydney/
> --server" to the main class and it deploys on the server as well.

My first guess would be that you need to be consistent with your path
separator characters. Windows expects backward slashes between each
level of the directory hierarchy.

-Andrew

Marko Burjek

unread,
Mar 2, 2015, 5:24:50 AM3/2/15
to OpenTripPlanner Developers
CC to mailing list.

One problem could be that you seem to need specify a router. For example:
instead of ./otp --graphs ../data/mariborNormal/ --serve
you need to use ./otp --graphs ../data --router mariborNormal --server

(I don't know how it's with slashes on Windows, this is for Linux)
Data is folder and each folder in data has GTFS/OSM files for graph.
router specifies name of wanted folder and if used only once default router.

New master also throws GraphNotFoundException for me if I don't use router and it seems I missed it in my first answer.

2015-03-02 7:23 GMT+01:00 Mohammad Haqqani <mohammad...@gmail.com>:
Hi Guys,

Thank you for your prompt response. I can build the graph right now but when I want to run OTP on server it gives me "GraphNotFoundException" error. I do have the "Graph.obj" and I pass "--graphs d:\OTP/Sydney/ --server" to the main class and it deploys on the server as well. However, when I go to "http://localhost:8080" it gives me this error and although that I can see the main page of OTP, but the drop down lists for "Start" and "End" are empty and nothing has loaded to them. I've also used the GTFS and OSM data for Portland as well but I got the same error. I've copied a part of error message which I got from OTP in below. Any help would be appreciated.

Kind Regards,
Mohammad


22:04:38.722 ERROR (GraphService.java:125) no graph registered with the routerId ''
org.opentripplanner.routing.error.GraphNotFoundException
at org.opentripplanner.routing.services.GraphService.getRouter(GraphService.java:126)
at org.opentripplanner.standalone.OTPServer.getRouter(OTPServer.java:76)
at org.opentripplanner.api.resource.Metadata.getMetadata(Metadata.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory€0.89.invoke(ResourceMethodInvocationHandlerFactory.java:81)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher€0.89.run(AbstractJavaResourceMethodDispatcher.java:151)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:171)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:195)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:104)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:384)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:342)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:101)
at org.glassfish.jersey.server.ServerRuntime€0.89.run(ServerRuntime.java:271)
at org.glassfish.jersey.internal.Errors€0.89.call(Errors.java:271)
at org.glassfish.jersey.internal.Errors€0.89.call(Errors.java:267)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:297)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:254)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1030)
at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:378)
at org.glassfish.grizzly.http.server.HttpHandler€0.89.run(HttpHandler.java:219)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:745) 


On Thursday, February 26, 2015 at 8:32:57 PM UTC+11, Mohammad Haqqani wrote:
Hi guys,

I am NOT a software developer and here is probably not a right place to ask this question and I've tried my best not to, but I couldn't figure it out by myself.

I am trying to run OTP in intelliJ on a windows 7 platform and I have downloaded the GTFS and openStreetMap data as well. however I don't know how to pass the parameters to the main class (which I think is the parameters should be the address of these files and also something for JVM configuration). I almost read the all the documents in opentripplanner.org but most of them was about running this on a linux machine using otp.jar file which is not my case. By the way I found this article as well but unfortunately it doesn't answer my question either.


this is the part of document that I don't know how to do: " your main class will be org.opentripplanner.standalone.OTPMain, and you may want to specify VM options to increase the JVM heap size (e.g. -Xmx4G to increase the limit to 4GB). Only the "Program arguments" will be different for building and serving a graph (see "Standalone Graph Build" [article to be completed])."

Any help would be appreciated.

Kind Regards,
Mohammad


Reply all
Reply to author
Forward
Message has been deleted
0 new messages