How to test my modified OTP version?

323 views
Skip to first unread message

Jordi Aranda

unread,
Nov 9, 2012, 11:02:04 AM11/9/12
to opentripp...@googlegroups.com
Hi all,

I know this is probably a pretty silly question but I don't know how to proceed. I've never worked with such a big project and I'm getting lost trying to figure out how everything works by just looking at the code. 

I already builded my own OSM map and I would like now to make my own modifications and see how changes take effect in the routing process. The question is that most of the stuff I want to modify are in the routing package (speeds, transportation modes, new vehicle definitions, ...). I compiled and packaged everything with maven but I don't know what files I actually need (or should deploy) in order to test my own version of OTP by using the browser, as in the examples provided. In the introductory guides only webapp and admin-webapp packages seem to be used but here is my question: how are routes computed? After having a look at those both packages I found out that the RESTful API is being used for this purpose but anyway I don't see any evidence of the routing package. What files are being used in all this process (user request, http routing responses,...). From my undersanding, once the user specifies the parameters in the UI, an http request should be triggered and the routing engine should do all the work (A* execution, result parsing), giving back an http response, which is at the end rendered back in the map to the user.

I would really appreciate your help.

Thank you in advance!

J.Aranda

Andrew Byrd

unread,
Nov 9, 2012, 11:36:58 AM11/9/12
to opentripp...@googlegroups.com
On 11/09/2012 05:02 PM, Jordi Aranda wrote:
> I already builded my own OSM map and I would like now to make my own
> modifications and see how changes take effect in the routing process.
> The question is that most of the stuff I want to modify are in the
> routing package (speeds, transportation modes, new vehicle definitions,
> ...). I compiled and packaged everything with maven but I don't know
> what files I actually need (or should deploy) in order to test my own
> version of OTP by using the browser, as in the examples provided.

Are you building/modifying OTP in Eclipse? Have you got unmodified OTP
up and running? If you are using Eclipse WTP, any changes you make
should deploy automatically to the Eclipse-managed web servlet.

> In the
> introductory guides only webapp and admin-webapp packages seem to be
> used but here is my question: how are routes computed? After having a
> look at those both packages I found out that the RESTful API is being
> used for this purpose but anyway I don't see any evidence of the routing
> package. What files are being used in all this process (user request,
> http routing responses,...).

The api-webapp project contains code for a Java servlet (web server
plugin) built using Jersey. The REST endpoints defined in the servlet
create routing requests from your query parameters and pass the requests
on to the core routing code from opentripplanner-routing. The api-webapp
project has a dependency on the routing project, so Maven includes the
routing .jar in the WEB-INF/lib directory when it's assembling the
api-webapp WAR (an all-in-one zipped webapp you can deploy to a servlet
container like Tomcat).

> From my undersanding, once the user
> specifies the parameters in the UI, an http request should be triggered
> and the routing engine should do all the work (A* execution, result
> parsing), giving back an http response, which is at the end rendered
> back in the map to the user.

That is right, but there is another layer: think of the api-webapp as a
REST frontend for the routing module, which does not speak HTTP itself.
Other components (like the analyst batch processor) can use the routing
code without going through the web API.

If you follow execution in the REST endpoints (subclasses of
RoutingResource.java, specifically Planner) you will reach PathService
in the routing project (via PlanGenerator).

-Andrew

Jordi Aranda

unread,
Nov 9, 2012, 12:39:12 PM11/9/12
to opentripp...@googlegroups.com


El viernes, 9 de noviembre de 2012 17:37:00 UTC+1, Andrew Byrd escribió:
On 11/09/2012 05:02 PM, Jordi Aranda wrote:
> I already builded my own OSM map and I would like now to make my own
> modifications and see how changes take effect in the routing process.
> The question is that most of the stuff I want to modify are in the
> routing package (speeds, transportation modes, new vehicle definitions,
> ...). I compiled and packaged everything with maven but I don't know
> what files I actually need (or should deploy) in order to test my own
> version of OTP by using the browser, as in the examples provided.

Are you building/modifying OTP in Eclipse? Have you got unmodified OTP
up and running? If you are using Eclipse WTP, any changes you make
should deploy automatically to the Eclipse-managed web servlet.

Yes, I got it working after ignoring some Javascript errors and I set up the Tomcat server in Eclipse. 

> In the
> introductory guides only webapp and admin-webapp packages seem to be
> used but here is my question: how are routes computed? After having a
> look at those both packages I found out that the RESTful API is being
> used for this purpose but anyway I don't see any evidence of the routing
> package. What files are being used in all this process (user request,
> http routing responses,...).

The api-webapp project contains code for a Java servlet (web server
plugin) built using Jersey. The REST endpoints defined in the servlet
create routing requests from your query parameters and pass the requests
on to the core routing code from opentripplanner-routing. The api-webapp
project has a dependency on the routing project, so Maven includes the
routing .jar in the WEB-INF/lib directory when it's assembling the
api-webapp WAR (an all-in-one zipped webapp you can deploy to a servlet
container like Tomcat).

That's exactly what I wanted to know.
 
> From my undersanding, once the user
> specifies the parameters in the UI, an http request should be triggered
> and the routing engine should do all the work (A* execution, result
> parsing), giving back an http response, which is at the end rendered
> back in the map to the user.

That is right, but there is another layer: think of the api-webapp as a
REST frontend for the routing module, which does not speak HTTP itself.
Other components (like the analyst batch processor) can use the routing
code without going through the web API.

If you follow execution in the REST endpoints (subclasses of
RoutingResource.java, specifically Planner) you will reach PathService
in the routing project (via PlanGenerator).

I will have a look. I think I'll be able to continue with my research with this info. Thanks!

-Andrew
Message has been deleted

Jordi Aranda

unread,
Nov 13, 2012, 12:11:10 PM11/13/12
to opentripp...@googlegroups.com
Okay, my last message was deleted (maybe for attaching some files?) so I will try to sum up my current problem which I described in my last reply. I'm trying to deploy OTP in my fresh VM (Ubuntu Server 12.04 64-bit) but I'm having some problems with Tomcat. I'm getting no errors with graph building, package compilation/packaging so I assume everything is ok. I added the code mentioned in https://github.com/openplans/OpenTripPlanner/wiki/RunningTheWebappInTomcat in my Tomcat policy files so the graph file (located under /otp) should be able to be read (actually it is because if I use this graph in the 2-min example app it loads successfully). I'm using its directory in the path property in the data-sources.xml file and I didn't modify the application-context.xml file (by now, I didn't find any necessity for that). When deploying both opentripplanner-api-webapp and opentripplanner-webapp the first one can't be started. Here you are the errors displayed in the tomcat log file:

INFO: HTMLManager: start: Starting web application at '/opentripplanner-api-webapp'
Nov 13, 2012 5:17:48 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Nov 13, 2012 5:17:52 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tileCache': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.opentripplanner.analyst.request.SampleFactory org.opentripplanner.analyst.request.TileCache.sampleFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sampleFactory': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.opentripplanner.analyst.core.GeometryIndex org.opentripplanner.analyst.request.SampleFactory.index; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'geometryIndex': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Could not retrieve default Graph from GraphService. Check its configuration.
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1074)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
        at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1276)
        at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:625)
        at org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.java:136)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:186)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:563)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:300)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:679)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.opentripplanner.analyst.request.SampleFactory org.opentripplanner.analyst.request.TileCache.sampleFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sampleFactory': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.opentripplanner.analyst.core.GeometryIndex org.opentripplanner.analyst.request.SampleFactory.index; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'geometryIndex': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Could not retrieve default Graph from GraphService. Check its configuration.
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:502)
        at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:282)
        ... 36 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sampleFactory': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.opentripplanner.analyst.core.GeometryIndex org.opentripplanner.analyst.request.SampleFactory.index; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'geometryIndex': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Could not retrieve default Graph from GraphService. Check its configuration.
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1074)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:844)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:786)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:703)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:474)
        ... 38 more
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.opentripplanner.analyst.core.GeometryIndex org.opentripplanner.analyst.request.SampleFactory.index; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'geometryIndex': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Could not retrieve default Graph from GraphService. Check its configuration.
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:502)
        at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:282)
        ... 49 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'geometryIndex': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Could not retrieve default Graph from GraphService. Check its configuration.
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1413)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:844)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:786)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:703)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:474)
        ... 51 more
Caused by: java.lang.IllegalStateException: Could not retrieve default Graph from GraphService. Check its configuration.
        at org.opentripplanner.analyst.core.GeometryIndex.initialzeComponent(GeometryIndex.java:61)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:340)
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:293)
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:130)
        ... 63 more
Nov 13, 2012 5:17:52 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
Nov 13, 2012 5:17:52 PM org.apache.catalina.core.ApplicationContext log
INFO: HTMLManager: list: Listing contexts for virtual host 'localhost'
Nov 13, 2012 5:25:45 PM org.apache.catalina.core.ApplicationContext log
INFO: HTMLManager: list: Listing contexts for virtual host 'localhost'
Nov 13, 2012 5:30:57 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextDestroyed()
Nov 13, 2012 5:30:57 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextDestroyed()

Any suggestions? It seems to be a configuration issue...

Thanks again for your help!

Jordi Aranda

unread,
Nov 14, 2012, 5:15:38 AM11/14/12
to opentripp...@googlegroups.com
The following errors appear in the browser as well: 

otp.config updated with default items from otp.config_static config.js:267
Failed to load resource: the server responded with a status of 500 (Internal Server Error) http://localhost:8080/opentripplanner-api-webapp/ws/metadata
failure retrieving default extent Map.js:161

I'm pretty sure it's an error related to the map loading process but I don't know how to get it fixed. Some more concrete logs:

SEVERE: Servlet.service() for servlet Jersey threw exception
java.lang.NullPointerException
        at org.opentripplanner.api.ws.GraphMetadata.<init>(GraphMetadata.java:52)
        at org.opentripplanner.api.ws.Metadata.getMetadata(Metadata.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
        at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185)
        at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
        at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
        at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
        at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
        at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
        at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:708)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
        at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
        at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
        at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
        at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
        at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
        at org.opentripplanner.web.authentication.WSSEAuthenticationFilter.doFilter(WSSEAuthenticationFilter.java:91)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.opentripplanner.jsonp.JsonpCallbackFilter.doFilter(JsonpCallbackFilter.java:71)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:679)

Having a look at both ws/GraphMetadata.java and ws/Metadata.java files it seems that in fact the map isn't being loaded. Any ideas?

Thanks for your time.

Jordi Aranda

unread,
Nov 14, 2012, 6:16:38 AM11/14/12
to opentripp...@googlegroups.com
The first log corresponded to my VM which used the current code in the repository. This last one used code from some weeks ago and I had no issues when deploying both .wars in Tomcat. It turns out some changes in code are having some issues... I will wait for further commits


El viernes, 9 de noviembre de 2012 17:02:05 UTC+1, Jordi Aranda escribió:

Andrew Byrd

unread,
Nov 14, 2012, 6:53:24 AM11/14/12
to opentripp...@googlegroups.com
On 11/14/2012 12:16 PM, Jordi Aranda wrote:
> The first log corresponded to my VM which used the current code in the
> repository. This last one used code from some weeks ago and I had no
> issues when deploying both .wars in Tomcat. It turns out some changes in
> code are having some issues... I will wait for further commits

Hi Jordi,

The current code passes all tests and I just checked that it handles
routing with no problem. You may have a configuration problem, but if
there are bugs we would want to fix them.

Your main error seems to be:
Could not retrieve default Graph from GraphService. Check its configuration.

Can you check farther back in the logs for messages indicating what went
wrong with the GraphService?

The GraphService is usually set up in data-sources.xml. Can you provide
the contents of your data-sources.xml?

Thanks,
Andrew

Jordi Aranda

unread,
Nov 14, 2012, 8:44:36 AM11/14/12
to opentripp...@googlegroups.com
Yes. Here you are my data-sources.xml within opentripplanner-api-webapp/src/main/resources:

<?xml version="1.0" encoding="UTF-8"?>

        <!-- import api-webapp application context -->
        <import resource="classpath:org/opentripplanner/api/application-context.xml" />

    <!-- specify a GraphService, configuring the path to the serialized Graphs -->
        <bean id="graphService" class="org.opentripplanner.routing.impl.GraphServiceImpl">
                <property name="path" value="/otp" />
        <!-- other optional properties for multiple graph registration -->
        <!-- 
        <property name="defaultRouterId" value="pdx" />
        <property name="autoRegister">
          <list>
            <value>nyc</value>
            <value>seattle</value>
          </list>
        </property>
        -->
        </bean>

</beans>

The Graph.obj is within /otp.

Jordi Aranda

unread,
Nov 14, 2012, 5:23:34 PM11/14/12
to opentripp...@googlegroups.com
It was my fault. I was not building my map with the current graph builder version so the graph object was always rejected. I rebuilded it with the current graph-builder and it was finally accepted. Now I'm facing another problem:

INFO: Deploying web application archive opentripplanner-api-webapp.war
2012-11-14 23:09:35,003 INFO  [ContextLoader.java:187] : Root WebApplicationContext: initialization started
2012-11-14 23:09:35,046 INFO  [AbstractApplicationContext.java:456] : Refreshing Root WebApplicationContext: startup date [Wed Nov 14 23:09:35 CET 2012]; root of context hierarchy
2012-11-14 23:09:35,112 INFO  [XmlBeanDefinitionReader.java:315] : Loading XML bean definitions from class path resource [data-sources.xml]
2012-11-14 23:09:35,607 INFO  [XmlBeanDefinitionReader.java:315] : Loading XML bean definitions from class path resource [org/opentripplanner/api/application-context.xml]
2012-11-14 23:09:35,679 INFO  [XmlBeanDefinitionReader.java:315] : Loading XML bean definitions from class path resource [org/opentripplanner/application-context.xml]
2012-11-14 23:09:36,080 INFO  [XmlBeanDefinitionReader.java:315] : Loading XML bean definitions from class path resource [org/opentripplanner/api/security-application-context.xml]
2012-11-14 23:09:36,205 INFO  [SpringSecurityCoreVersion.java:22] : You are running with Spring Security Core 3.0.5.RELEASE
2012-11-14 23:09:36,205 INFO  [SecurityNamespaceHandler.java:57] : Spring Security 'config' module version is 3.0.5.RELEASE
2012-11-14 23:09:36,356 INFO  [HttpSecurityBeanDefinitionParser.java:188] : Checking sorted filter chain: [Root bean: class [org.springframework.security.web.context.SecurityContextPersistenceFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 300, <wsseAuthenticationFilter>, order = 1200, Root bean: class [org.springframework.security.web.savedrequest.RequestCacheAwareFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1300, Root bean: class [org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1400, Root bean: class [org.springframework.security.web.authentication.AnonymousAuthenticationFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1600, Root bean: class [org.springframework.security.web.session.SessionManagementFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1700, Root bean: class [org.springframework.security.web.access.ExceptionTranslationFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1800, <org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0>, order = 1900]
2012-11-14 23:09:36,655 INFO  [AbstractApplicationContext.java:1332] : Bean '(inner bean)' of type [class org.springframework.security.access.annotation.SecuredAnnotationSecurityMetadataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2012-11-14 23:09:36,661 INFO  [AbstractApplicationContext.java:1332] : Bean '(inner bean)#1' of type [class org.springframework.security.access.annotation.Jsr250MethodSecurityMetadataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2012-11-14 23:09:36,664 INFO  [AbstractApplicationContext.java:1332] : Bean 'org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource#0' of type [class org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2012-11-14 23:09:36,674 INFO  [AbstractApplicationContext.java:1332] : Bean 'org.springframework.security.methodSecurityMetadataSourceAdvisor' of type [class org.springframework.security.access.intercept.aopalliance.MethodSecurityMetadataSourceAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2012-11-14 23:09:36,674 INFO  [AbstractApplicationContext.java:1332] : Bean 'org.springframework.security.methodSecurityMetadataSourceAdvisor' of type [class org.springframework.security.access.intercept.aopalliance.MethodSecurityMetadataSourceAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2012-11-14 23:09:36,717 INFO  [DefaultListableBeanFactory.java:555] : Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@7df33bb0: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,patchServiceImpl,SPTCache,renderer,tileCache,sampleFactory,sampleCache,geometryIndex,raster,planGenerator,prototypeRoutingRequest,pathService,heuristicFactory,sptService,jsonpCallbackFilter,graphService,org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource#0,org.springframework.security.access.vote.AffirmativeBased#0,org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor#0,org.springframework.security.methodSecurityMetadataSourceAdvisor,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.security.web.PortMapperImpl#0,org.springframework.security.web.context.HttpSessionSecurityContextRepository#0,org.springframework.security.web.authentication.session.SessionFixationProtectionStrategy#0,org.springframework.security.authentication.ProviderManager#0,org.springframework.security.access.vote.AffirmativeBased#1,org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0,org.springframework.security.web.access.DefaultWebInvocationPrivilegeEvaluator#0,org.springframework.security.authentication.AnonymousAuthenticationProvider#0,org.springframework.security.web.savedrequest.HttpSessionRequestCache#0,org.springframework.security.config.http.UserDetailsServiceInjectionBeanPostProcessor#0,org.springframework.security.filterChainProxy,wsseProvider,wsseAuthenticationEntryPoint,wsseAuthenticationFilter,org.springframework.security.authentication.DefaultAuthenticationEventPublisher#0,org.springframework.security.authenticationManager]; root of factory hierarchy
2012-11-14 23:09:36,769 INFO  [GraphServiceImpl.java:114] : no list of routerIds was provided for automatic registration.
2012-11-14 23:09:36,771 INFO  [GraphServiceImpl.java:117] : Attempting to load graph for default routerId ''.
2012-11-14 23:09:36,772 DEBUG [GraphServiceImpl.java:230] : evicting graph
2012-11-14 23:09:36,772 INFO  [GraphServiceImpl.java:209] : registering routerId
2012-11-14 23:09:36,773 DEBUG [GraphServiceImpl.java:165] : loading serialized graph for routerId
2012-11-14 23:09:36,774 DEBUG [GraphServiceImpl.java:167] : graph file for routerId '' is at file:/otp///Graph.obj
2012-11-14 23:09:36,774 DEBUG [GraphServiceImpl.java:179] : graph input stream successfully opened. now loading.
2012-11-14 23:09:36,792 INFO  [MavenVersion.java:44] : Parsed Maven artifact version: 0.9.2-SNAPSHOT => MavenVersion(0, 9, 2, SNAPSHOT, b7c24958ca8c24bab5fe598cb15eb57faebf1452) UID=-9002
2012-11-14 23:09:37,509 DEBUG [Graph.java:359] : Basic graph info read.
2012-11-14 23:09:37,510 INFO  [Graph.java:407] : Graph version: MavenVersion(0, 9, 2, SNAPSHOT, b7c24958ca8c24bab5fe598cb15eb57faebf1452)
2012-11-14 23:09:37,511 INFO  [Graph.java:408] : OTP version:   MavenVersion(0, 9, 2, SNAPSHOT, b7c24958ca8c24bab5fe598cb15eb57faebf1452)
2012-11-14 23:09:37,512 INFO  [Graph.java:425] : This graph was built with the currently running version and commit of OTP.
2012-11-14 23:09:37,512 DEBUG [Graph.java:366] : Loading edges...
2012-11-14 23:09:44,186 INFO  [DefaultSingletonBeanRegistry.java:422] : Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@7df33bb0: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,patchServiceImpl,SPTCache,renderer,tileCache,sampleFactory,sampleCache,geometryIndex,raster,planGenerator,prototypeRoutingRequest,pathService,heuristicFactory,sptService,jsonpCallbackFilter,graphService,org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource#0,org.springframework.security.access.vote.AffirmativeBased#0,org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor#0,org.springframework.security.methodSecurityMetadataSourceAdvisor,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.security.web.PortMapperImpl#0,org.springframework.security.web.context.HttpSessionSecurityContextRepository#0,org.springframework.security.web.authentication.session.SessionFixationProtectionStrategy#0,org.springframework.security.authentication.ProviderManager#0,org.springframework.security.access.vote.AffirmativeBased#1,org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0,org.springframework.security.web.access.DefaultWebInvocationPrivilegeEvaluator#0,org.springframework.security.authentication.AnonymousAuthenticationProvider#0,org.springframework.security.web.savedrequest.HttpSessionRequestCache#0,org.springframework.security.config.http.UserDetailsServiceInjectionBeanPostProcessor#0,org.springframework.security.filterChainProxy,wsseProvider,wsseAuthenticationEntryPoint,wsseAuthenticationFilter,org.springframework.security.authentication.DefaultAuthenticationEventPublisher#0,org.springframework.security.authenticationManager]; root of factory hierarchy
2012-11-14 23:09:44,188 ERROR [ContextLoader.java:220] : Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'patchServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.opentripplanner.routing.impl.PatchServiceImpl.setGraphService(org.opentripplanner.routing.services.GraphService); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'graphService': Invocation of init method failed; nested exception is java.lang.OutOfMemoryError: Java heap space
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1074)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:525)
        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1359)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:857)
        at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:795)
        at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1475)
        at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:250)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:558)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:679)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.opentripplanner.routing.impl.PatchServiceImpl.setGraphService(org.opentripplanner.routing.services.GraphService); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'graphService': Invocation of init method failed; nested exception is java.lang.OutOfMemoryError: Java heap space
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:589)
        at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:282)
        ... 45 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'graphService': Invocation of init method failed; nested exception is java.lang.OutOfMemoryError: Java heap space
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1413)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:844)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:786)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:703)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:547)
        ... 47 more
Caused by: java.lang.OutOfMemoryError: Java heap space
        at java.io.ObjectInputStream$HandleTable.grow(ObjectInputStream.java:3435)
        at java.io.ObjectInputStream$HandleTable.assign(ObjectInputStream.java:3243)
        at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1651)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1340)
        at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1963)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1887)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1770)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
        at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1963)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1887)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1770)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
        at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1963)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1887)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1770)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:368)
        at org.opentripplanner.routing.graph.Graph.load(Graph.java:367)
        at java.util.ArrayList.readObject(ArrayList.java:696)
        at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:988)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1865)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1770)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:368)at org.opentripplanner.routing.graph.Graph.load(Graph.java:351)
        at org.opentripplanner.routing.impl.GraphServiceImpl.loadGraph(GraphServiceImpl.java:181)
        at org.opentripplanner.routing.impl.GraphServiceImpl.registerGraph(GraphServiceImpl.java:210)
        at org.opentripplanner.routing.impl.GraphServiceImpl.startup(GraphServiceImpl.java:118)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Nov 14, 2012 11:09:44 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Nov 14, 2012 11:09:44 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/opentripplanner-api-webapp] startup failed due to previous errors
        
So, after all, it turns out to be a heap space issue. I have already tried to set both CATALINA_OPTS/JAVA_OPTS variables to "-Xmx2048m" but without much success, I'm getting still the same error. How much memory is supposed to be necessary?

Andrew Byrd

unread,
Nov 14, 2012, 5:33:27 PM11/14/12
to opentripp...@googlegroups.com
Hi Jordi,

Yes, your key error is:
"Caused by: java.lang.OutOfMemoryError: Java heap space"

The amount of memory needed depends greatly on the size of your graph. I
am currently working with a very big graph for the entire New York City
region which needs 4+ GB to run smoothly. Smaller graphs may use much
less space.

I have never run into a case where starting the server required more
memory than the graph building process, though. How large did you set
the heap when running the graph builder?

-Andrew
> http://www.springframework.org/schema/beans/spring-beans-2.5.xsd

Jordi Aranda

unread,
Nov 15, 2012, 5:03:48 AM11/15/12
to opentripp...@googlegroups.com
I finally solved this issue :-)

The fact is that I set both env variables but they weren't taken into account by the Tomcat service. The solution was to modify the /etc/default/tomcat6 file.

Thanks Andrew!

Andrew Byrd

unread,
Nov 15, 2012, 5:39:57 AM11/15/12
to opentripp...@googlegroups.com
On 11/15/2012 11:03 AM, Jordi Aranda wrote:
> The fact is that I set both env variables but they weren't taken into
> account by the Tomcat service. The solution was to modify the
> /etc/default/tomcat6 file.

Good to hear you got it resolved. I just added this information to the
Tomcat setup page at:

https://github.com/openplans/OpenTripPlanner/wiki/RunningTheWebappInTomcat

We should really mention heap size settings more clearly (I only see
them discussed biefly in the Eclipse setup) and provide some clearer
guidelines on memory use. Ticketed.

-Andrew

Reply all
Reply to author
Forward
0 new messages