Failed in deploying OTP 0.11.0

487 views
Skip to first unread message

Zhongzheng He

unread,
Apr 13, 2014, 11:09:57 AM4/13/14
to opentripp...@googlegroups.com
Hi all,

I've met a problem when I tried deploying OTP 0.11.0 on my local PC. I followed the tutorial 
and imported the project successfully. I also followed the turorial 
at the fourth step "Added both the opentripplanner-api-webapp and opentripplanner-webapp modules to your Tomcat server instance." I added the otp-rest-servlet because of the changing of the project structure since version 0.11.0. My objective is setting up a server providing the transit APIs to which I can requst for transit indexes such as routes and stops etc., so I think otp-rest-servlet is enough. But after I start the server I got nothing but 404 when I requesting the APIs. I'm sure that the graph data is OK and I've checked it for many times, and I also changed the configuration of the data path in data-source.xml. 


When I tried 'maven install' operation (after the 'maven clean' operation) the console presents the following error logs:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building OpenTripPlanner REST API Servlet 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.opentripplanner:otp-core:jar:1.0.0-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.418s
[INFO] Finished at: Sun Apr 13 16:46:44 CEST 2014
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project otp-rest-servlet: Could not resolve dependencies for project org.opentripplanner:otp-rest-servlet:war:1.0.0-SNAPSHOT: Could not find artifact org.opentripplanner:otp-core:jar:1.0.0-SNAPSHOT in central2 (http://repo1.maven.org/maven2) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:

Am I doing it right? Or what is the reason? I can't find other supports cause the tutorials on GItHub are not 100% the same with the situation in 0.11.0

Looking forward to your reply, thank you.

Regards,

Zhongzheng

Marko Burjek

unread,
Apr 13, 2014, 12:46:06 PM4/13/14
to opentripp...@googlegroups.com
Hi!

First problem seems to be that you are building master branch "Building OpenTripPlanner REST API Servlet 1.0.0-SNAPSHOT".
You should switch branches after you download code from git. How exactly do you do that I don't know, because I don't use Eclipse. But it seems that you should go right clik on the project and choose Switch. http://www.vogella.com/tutorials/EclipseGit/article.html#team_operations
You are looking for branch 0.11.x.

But there is a second problem. Master which seem that you used should compile.
Both Master and 0.11.x branch are already using new standalone server, so If you don't have any special needs for tomcat. You can start the server as ./otp --server. otp is a file in a root OpenTripplanner folder. ./otp also has options to create graphs, where graph folder is and runs a server.

Yes sadly the documentation is very confusing. But people are working on it that it will be ok in version 1.0.

Regards,
Marko

Zhongzheng He

unread,
Apr 14, 2014, 6:37:34 AM4/14/14
to opentripp...@googlegroups.com
Hi Marko!

Thank you for your help! And sorry for my late reply.

I've fixed the first problem as you suggested, and also built all the entire projects, now the "BUILD FAILURE" error is fixed and success, also when I started up the server all the things went well in log, the Graph.obj was found successfully, no errors in the log, but I still can not access the APIs successfully, the situation was the same: I got nothing but 404 from the APIs except '/otp-rest-servlet/ws/routers', it seems that it's the only API working. My requesting url was:


I added modules: 'otp-admin-client', 'otp-leaflet-client', 'otp-openlayers-client', 'otp-rest-servlet' to my tomcat server in eclipse.

The log of starting up server is as below:
--------------------------------------Start-------------------------------------------------
Apr 14, 2014 12:08:57 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: E:\Tools\JDK\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;E:/Tools/JDK/bin/../jre/bin/client;E:/Tools/JDK/bin/../jre/bin;E:/Tools/JDK/bin/../jre/lib/i386;E:\Tools\Developments\apache-maven-3.2.1\bin;E:\Tools\Developments\Git\cmd;E:\Tools\JDK\bin;E:\Tools\JDK\jre\bin;C:\Program Files\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;E:\Tools\Developments\TortoiseGit\bin;E:\Tools\Developments\Node\;C:\Users\Joshua\AppData\Roaming\npm;E:\Tools\eclipse;;.
Apr 14, 2014 12:08:57 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:otp-rest-servlet' did not find a matching property.
Apr 14, 2014 12:08:57 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:otp-admin-client' did not find a matching property.
Apr 14, 2014 12:08:57 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:otp-leaflet-client' did not find a matching property.
Apr 14, 2014 12:08:57 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:otp-openlayers-client' did not find a matching property.
Apr 14, 2014 12:08:58 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Apr 14, 2014 12:08:58 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Apr 14, 2014 12:08:58 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 846 ms
Apr 14, 2014 12:08:58 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Apr 14, 2014 12:08:58 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.35
12:09:05.073 INFO (DirectJDKLog.java:183) Initializing Spring root WebApplicationContext
12:09:06.445 INFO (GraphServiceImpl.java:97) no list of routerIds was provided for automatic registration.
12:09:06.446 INFO (GraphServiceImpl.java:101) Attempting to load graph for default routerId ''.
12:09:06.447 INFO (GraphServiceFileImpl.java:229) registering routerId ''
12:09:06.448 INFO (GraphServiceFileImpl.java:172) Loading graph...
12:09:06.456 INFO (MavenVersion.java:53) Parsed Maven artifact version: 0.11.1-SNAPSHOT => MavenVersion(0, 11, 1, SNAPSHOT, e0f5a86e8bcf9e669b57cbacc20271db66b603d1) UID=-11001
12:09:06.677 INFO (Graph.java:558) Graph version: MavenVersion(0, 11, 1, SNAPSHOT, e0f5a86e8bcf9e669b57cbacc20271db66b603d1)
12:09:06.677 INFO (Graph.java:559) OTP version:   MavenVersion(0, 11, 1, SNAPSHOT, e0f5a86e8bcf9e669b57cbacc20271db66b603d1)
12:09:06.678 INFO (Graph.java:576) This graph was built with the currently running version and commit of OTP.
12:09:13.230 INFO (Graph.java:528) Main graph read. |V|=13631 |E|=35733
12:09:13.397 INFO (GraphUpdaterConfigurator.java:69) Using configurations:  
12:09:14.145 INFO (PackagesResourceConfig.java:101) Scanning for root resource and provider classes in the packages:
  org.opentripplanner
12:09:14.392 INFO (ScanningResourceConfig.java:153) Root resource classes found:
  class org.opentripplanner.api.resource.analyst.LIsochrone
  class org.opentripplanner.api.resource.TransitIndex
  class org.opentripplanner.api.resource.ProfileEndpoint
  class org.opentripplanner.api.resource.analyst.SimpleIsochrone
  class org.opentripplanner.api.resource.analyst.TileService
  class org.opentripplanner.api.resource.Patcher
  class org.opentripplanner.api.resource.ServerInfo
  class org.opentripplanner.api.resource.Routers
  class org.opentripplanner.api.resource.GeocoderResource
  class org.opentripplanner.api.resource.analyst.WebMapService
  class org.opentripplanner.api.resource.analyst.LegendResource
  class org.opentripplanner.api.resource.Metadata
  class org.opentripplanner.api.resource.analyst.SIsochrone
  class org.opentripplanner.api.resource.BikeRental
  class org.opentripplanner.api.resource.analyst.Raster
  class org.opentripplanner.api.resource.Planner
12:09:14.392 INFO (ScanningResourceConfig.java:153) Provider classes found:
  class org.opentripplanner.api.parameter.CRSStringReaderProvider
  class org.opentripplanner.api.parameter.WMSTimeStringReaderProvider
  class org.opentripplanner.api.parameter.EnvelopeStringReaderProvider
  class org.opentripplanner.api.common.JerseyInjector
12:09:14.551 INFO (SpringServlet.java:136) Using default applicationContext
12:09:14.586 INFO (SpringComponentProviderFactory.java:111) Registering Spring bean, raster, of type org.opentripplanner.api.resource.analyst.Raster as a root resource class
12:09:14.594 INFO (WebApplicationImpl.java:790) Initiating Jersey application, version 'Jersey: 1.17.1 02/28/2013 12:47 PM'
12:09:16.895 INFO (DirectJDKLog.java:183) Starting ProtocolHandler ["http-bio-8080"]
12:09:16.908 INFO (DirectJDKLog.java:183) Starting ProtocolHandler ["ajp-bio-8009"]
12:09:16.909 INFO (DirectJDKLog.java:183) Server startup in 18684 ms
--------------------------------------End---------------------------------------------------

Also I found this in otp-leaflet-client>src>main>webapp>js>otp>config.js:
otp.config = {
    debug: false,

    /**
     * The OTP web service locations
     */
    hostname : "http://localhost:8080",
    //municoderHostname : "http://localhost:8080",
    //datastoreUrl : 'http://localhost:9000',
    // In the 0.10.x API the base path is "otp-rest-servlet/ws"
    // From 0.11.x onward the routerId is a required part of the base path.
    // If using a servlet container, the OTP WAR should be deployed to context path /otp/v0
    restService: "otp-rest-servlet/ws",
.......
}

I changed the hostname and restService as shown but the situation stay still.

Did I do it right? Or should I modify the requesting url?

Looking for your reply and thank you again.

Regards,

Zhongzheng

Andrew Byrd

unread,
Apr 14, 2014, 9:24:04 AM4/14/14
to opentripp...@googlegroups.com
On 04/14/2014 12:37 PM, Zhongzheng He wrote:
> it seems that it's the only API working. My requesting url was:
>
> http://localhost:8080/otp-rest-servlet/ws/transit/agencyIds
Please consult the API docs at http://docs.opentripplanner.org/apidoc/
Assuming you are using version 0.11.0, the call you are trying to make
is described at:
http://docs.opentripplanner.org/apidoc/0.11.0/resource_TransitIndex.html#path__routers_-routerId-_transit_agencyIds.html

If you are using the standalone OTP server, the default base path for
the API in this version is /otp so you'll want:
http://localhost:8080/otp/routers/default/transit/agencyIds

However in order for most of the transit index calls to work you'd need
to build the graph with the --transitIndex switch.

-Andrew

Zhongzheng He

unread,
Apr 15, 2014, 4:50:32 AM4/15/14
to opentripp...@googlegroups.com
Hi Andrew!

Thank you for your help! All the APIs works well now except the one 'stopTimesForTrip', it respondes with 500 error. I read the document and got confused about the parameter 'time', what time is expected to get desired outcome? I check the stopId and tripId and 100% sure that the trip do pass the stop, so I think time parameter could be the only problem.

Looking forward to your reply, and thank you again!

Regards,

Zhongzheng

Marko Burjek

unread,
Apr 15, 2014, 5:20:29 AM4/15/14
to opentripp...@googlegroups.com
It's Unixtimestamp in seconds: http://www.onlineconversion.com/unix_time.htm
Example query: http://localhost:8080/otp-rest-servlet/ws/transit/stopTimesForStop?agency=1&id=117&startTime=1397523600&endTime=1397610000&extended=true ofcourse change agency and id of the stop and you should get something. If time is till the problem multiply with 1000 so that you have unixtime in milliseconds. I don't know which type 0.11.x uses.

Regards,
Marko


--
You received this message because you are subscribed to a topic in the Google Groups "OpenTripPlanner Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/opentripplanner-dev/sCz6INgfe0M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to opentripplanner...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Zhongzheng He

unread,
Apr 15, 2014, 6:00:28 AM4/15/14
to opentripp...@googlegroups.com
Hi Marko,

Thank you for your very fast reply. Sorry that I didn't make my quesstion clear. Time format is not a problem, I read the documentation of the RESTful APIs in 0.11.x: 
and followed the standards, according to the document the time format is in seconds since epoch. My quesstion is what time should I provide. The name of the parameter is just 'time' rather than 'starttime' or 'endtime' etc., so I'm confused what time should I provide. I want to get the stoptimes of a trip (at a speciafic stop if the stopId is necessary), why I have to provide a time?

Thank you again and looking forward to your reply.

Regards,

Zhongzheng
Reply all
Reply to author
Forward
0 new messages