Graphbuilder & localhost

216 views
Skip to first unread message

Dzenan

unread,
Oct 8, 2013, 8:49:10 AM10/8/13
to opentripp...@googlegroups.com
Hi Community,

I deal with two problems and I hope to find help:


1) I want to build up my own graph.obj but I 'm facing some problems regarding the new structure of OTP. I worked with the project a year ago with version 0.74 and the graphbuilding process worked out fine that days. Now, there are issues concerning the arguments that I have to pass in Eclipse since the error message hints, that the config.xml is needed ("usage: config.xml"). I don't now the path to this file. Is there anything else that I need to do in order to receive a compiled graph object?

2) Due to the changed modules in OTP I don't now which ones I have to add to the Tomcat server. Back in the days I remember that I had to add 4 modules: api-webapp, webapp, anaylst-client and geocoder. The last two do still exist, but what about the other modules? There are five others. Which of them do I have to add to Tomcat. If I insert all of them there is the following error: "Could not publish to the server. java.lang.IndexOutOfBoundsException". Using another Laptop I was able to start the server adding all modules but I cannot access the webapp via: http://localhost:8080/opentripplanner-webapp/. What am I doing wrong?

I hope there is someone out there to help me!

Thanks a lot!

Greetings,
Dzenan


Dzenan

unread,
Oct 8, 2013, 9:09:22 AM10/8/13
to opentripp...@googlegroups.com
Hi again,

if I try to add the src\main\resources\org\opentripplanner\graph_builder.xml as programm argument to build the graph there is the following error: 

Exception in thread "main" 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 field: private org.opentripplanner.routing.services.GraphService org.opentripplanner.routing.impl.PatchServiceImpl.graphService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [org.opentripplanner.routing.services.GraphService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
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.opentripplanner.graph_builder.GraphBuilderMain.createContext(GraphBuilderMain.java:84)
at org.opentripplanner.graph_builder.GraphBuilderMain.main(GraphBuilderMain.java:54)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.opentripplanner.routing.services.GraphService org.opentripplanner.routing.impl.PatchServiceImpl.graphService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [org.opentripplanner.routing.services.GraphService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
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)
... 12 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [org.opentripplanner.routing.services.GraphService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:920)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:789)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:703)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:474)
... 14 more


Do I need to provide another argument?

Greetings,
Dzenan

Andrew Byrd

unread,
Oct 8, 2013, 9:11:06 AM10/8/13
to opentripp...@googlegroups.com
Hello,

The master branch of OpenTripPlanner is being restructured and
refactored to run without a servlet container. If you would like to use
the familiar old structure, please use the 'stable' branch.

The proper module to deploy to a servlet container in the new structure
is otp-rest-servlet. We have not been using this much on the master
branch so please report any bugs or errors you encounter.

Regarding your point number 1, I am not sure what is different for you
now. The graph builder has always required you to specify a
configuration file on the command line.

-Andrew
> --
> 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/groups/opt_out.

Andrew Byrd

unread,
Oct 8, 2013, 9:12:09 AM10/8/13
to opentripp...@googlegroups.com
Laurent, might this be related to the problem you mentioned involving
the missing application-context?

Dzenan

unread,
Oct 8, 2013, 10:18:42 AM10/8/13
to opentripp...@googlegroups.com
Hi Andrew,

thank you for your quick answer. Regaring point number 1 I did not use the command line. I did ran the graph builder in eclipse, not via the build-graph.bat. During my work I had to adjust the structure of the graph because I added the a third dimension using altitude for each node to calculate an efficient route. Therefore, I adjusted the paths in the required files: graph-builder.xml, batch-context, data-sources. I did build the graph builder some time ago and do not remember which file I have to add to the programm arguments. Can you please help me remember? Which config file?

I have issues with Tomcat that I have to fix on my main machine. On the other laptop adding the otp-rest-servlet should work after I am able to build a new graph.obj, because the version of my current graph object seems to be outdated and causes an exception. 

I will work with OTP for some time and hope to find help in the future. OTP is a great project and I would like to thank you all for your time and patience. 

Greetings,
Dzenan

Laurent GRÉGOIRE

unread,
Oct 8, 2013, 10:26:45 AM10/8/13
to opentripp...@googlegroups.com
Hi,

On 08/10/2013 15:12, Andrew Byrd wrote:
> Laurent, might this be related to the problem you mentioned involving
> the missing application-context?

I'm not sure, the error was more direct, something like "missing
application-context.xml". Unless this error occurs with my patch
applied? In that case that would make more sense.

HTH,

--Laurent

Dzenan

unread,
Oct 8, 2013, 10:40:13 AM10/8/13
to opentripp...@googlegroups.com
Hi Laurent,

the file application-context does exist. I did not change any of its content. Is it a generated file, as I guessed or do I have to apply changes to it?

Greetings,
Dzenan

Dzenan

unread,
Oct 9, 2013, 4:02:55 AM10/9/13
to opentripp...@googlegroups.com
Hi there,

I tried to run the graph builder using the graph-builder.xml as program argument. The content of the graph-builder.xml is the following:

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

    <bean id="gtfsBuilder" class="org.opentripplanner.graph_builder.impl.GtfsGraphBuilderImpl">
        <property name="gtfsBundles">
            <bean id="gtfsBundles" class="org.opentripplanner.graph_builder.model.GtfsBundles">
                <property name="bundles">
                    <list>
                        <bean class="org.opentripplanner.graph_builder.model.GtfsBundle">
                            <property name="path" value="C:\otp\cache\gtfs\" />
                            <property name="defaultBikesAllowed" value="true" />
                        </bean>
                    </list>
                </property>
            </bean>
        </property>
    </bean>

    <bean id="osmBuilder" class="org.opentripplanner.graph_builder.impl.osm.OpenStreetMapGraphBuilderImpl">
        <property name="provider">
            <bean class="org.opentripplanner.openstreetmap.impl.RegionBasedOpenStreetMapProviderImpl">
                <property name="regionsSource">
                    <bean class="org.opentripplanner.graph_builder.impl.TransitStopsRegionsSourceImpl" />
                </property>
                <property name="cacheDirectory" value="C:\otp\cache\osm\" />
            </bean>
        </property>
        <property name="defaultWayPropertySetSource">
            <bean class="org.opentripplanner.graph_builder.impl.osm.DefaultWayPropertySetSource" />
        </property>
    </bean>

    <bean id="floatingIslands" class="org.opentripplanner.graph_builder.impl.PruneFloatingIslands">
        <property name="islandWithoutStopsMaxSize" value="1000 "/>
        <property name="islandLogFile" value="{graphPath}/island.csv"/>
        <property name="islandWithStopsMaxSize" value="20"/>
        <property name="transitToStreetNetwork" ref ="transitStreetLink"/>
    </bean>

    <bean id="transitStreetLink" class="org.opentripplanner.graph_builder.impl.TransitToStreetNetworkGraphBuilderImpl" />

    <bean id="graphBuilderTask" class="org.opentripplanner.graph_builder.GraphBuilderTask">
        <property name="path" value="/home/otp/graph-bundle" />
        <property name="graphBuilders">
            <list>
                <!-- GTFS comes before OSM, because we use the loaded set of stops to determine our OSM coverage -->
                <ref bean="gtfsBuilder" />
                <ref bean="osmBuilder" />
                <!-- the transmit link should became before the floating islands in order to find islands with stops-->
                <ref bean="transitStreetLink" />
                <ref bean="floatingIslands" />

            </list>
        </property>
    </bean>
</beans>


The following error occurs:

Exception in thread "main" 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 field: private org.opentripplanner.routing.services.GraphService org.opentripplanner.routing.impl.PatchServiceImpl.graphService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [org.opentripplanner.routing.services.GraphService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
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.opentripplanner.graph_builder.GraphBuilderMain.createContext(GraphBuilderMain.java:85)
at org.opentripplanner.graph_builder.GraphBuilderMain.main(GraphBuilderMain.java:54)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.opentripplanner.routing.services.GraphService org.opentripplanner.routing.impl.PatchServiceImpl.graphService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [org.opentripplanner.routing.services.GraphService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
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)
... 12 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [org.opentripplanner.routing.services.GraphService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:920)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:789)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:703)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:474)
... 14 more

Is there anything wrong with the graph-builer.xml or is there a another mistake that I made?

Greetings,
Dzenan

Laurent GRÉGOIRE

unread,
Oct 9, 2013, 7:04:07 AM10/9/13
to opentripp...@googlegroups.com
Hi Dzenan,

On 09/10/2013 10:02, Dzenan wrote:
> org.springframework.beans.factory.NoSuchBeanDefinitionException: No
> matching bean of type
> [org.opentripplanner.routing.services.GraphService] found for
> dependency: expected at least 1 bean which qualifies as autowire
> candidate for this dependency. Dependency annotations:

Your error is that there is no GraphService bean defined/found to
inject. It's rather unusual.

> Is there anything wrong with the graph-builer.xml or is there a another
> mistake that I made?

What version are you using? Andrew recently commited a change for the
missing graph builder application-context.xml file in master, you may
want to try again with the latest version.

HTH,

--Laurent


Dzenan

unread,
Oct 9, 2013, 8:12:29 AM10/9/13
to opentripp...@googlegroups.com
Hi Laurent,

I did checkout the version 0.9.2 a few weeks ago. I'm working to apply changes to OTP as task of my master thesis. I'm a user of an electic wheelchair and address my own needs trying to calculate efficient routes using altitude and street surfaces (i wrote a parser that creates enriched OSM-files). I figured out that I should work with the stable version, because I want to add a profile for users of electric wheelchairs as a plugin. Therefore, I need to add specific data concerning the wheelchair use such as a maximal doable incline, maximum speed and so on. Working with the master branch could be crutial because of the changes to it and my limited time. After completion of my master thesis I am interested in working with the master branch und surley there is some interest in a collaboration. Thank you for your support so far.

Greetings,
Dzenan

Laurent GRÉGOIRE

unread,
Oct 10, 2013, 5:17:16 AM10/10/13
to opentripp...@googlegroups.com
Hi Dzenan,

On 09/10/2013 14:12, Dzenan wrote:
> I did checkout the version 0.9.2 a few weeks ago. I'm working to apply
> changes to OTP as task of my master thesis. I'm a user of an electic
> wheelchair and address my own needs trying to calculate efficient routes
> using altitude and street surfaces (i wrote a parser that creates
> enriched OSM-files). I figured out that I should work with the stable
> version, because I want to add a profile for users of electric
> wheelchairs as a plugin. Therefore, I need to add specific data
> concerning the wheelchair use such as a maximal doable incline, maximum
> speed and so on. Working with the master branch could be crutial because
> of the changes to it and my limited time. After completion of my master
> thesis I am interested in working with the master branch und surley
> there is some interest in a collaboration. Thank you for your support so
> far.

If you plan to apply changes to OTP, you can also make a public fork in
github itself. Then you can create pull requests to push back your
changes (or a subset of them) into the main development repository. But
maybe you are already doing so in that case please ignore my comment :)

Also did your initial issue with the graph builder is solved?
(GraphService not found when doing dependency injection).

HTH,

--Laurent

Dzenan

unread,
Oct 11, 2013, 11:03:17 AM10/11/13
to opentripp...@googlegroups.com
Hi Laurent,

thank you for you suggestion. I will consider it for teh future. At the moment I have restricions to develope on a locale machine. My supervisor does not want me to share my code unitl I finished my master thesis. Because of this I have to use a stable version. After finishing my mather thesis I would like to get rid of theses restrictions and push my code. I try to work with a modular approach such that integration of my code should be fairly easy.

I was able to solve the graph builder problem by switching to the stable branch.:D

Greetings,
Dzenan    

Laurent GRÉGOIRE

unread,
Oct 11, 2013, 12:43:43 PM10/11/13
to opentripp...@googlegroups.com
Hi Dzenan,

On 11/10/2013 17:03, Dzenan wrote:
> [...] My supervisor
> does not want me to share my code unitl I finished my master thesis.
> Because of this I have to use a stable version. After finishing my
> mather thesis I would like to get rid of theses restrictions and push my
> code.

Be careful, as OTP is an open-source project (LGPL) any addition /
modification to the source code itself *have to* be made public. So I
think your supervisor will have no other option than letting your work
on OTP be shared. However I do not think having to wait until the end of
your master thesis is really a problem, but I'm not a lawyer so I can't
say for sure :)

> I was able to solve the graph builder problem by switching to the stable
> branch.:D

Good to hear!

HTH,

--Laurent


Andrew Byrd

unread,
Oct 11, 2013, 1:27:15 PM10/11/13
to opentripp...@googlegroups.com
On 10/11/2013 06:43 PM, Laurent GR�GOIRE wrote:
> Hi Dzenan,
>
> On 11/10/2013 17:03, Dzenan wrote:
>> [...] My supervisor
>> does not want me to share my code unitl I finished my master thesis.
>
> Be careful, as OTP is an open-source project (LGPL) any addition /
> modification to the source code itself *have to* be made public. So I
> think your supervisor will have no other option than letting your work
> on OTP be shared.

Of course I also encourage you to contribute your modifications back to
the community, but the GPL is not quite this strict. A person or an
organization can make private modifications to GPL software and is not
required to release the source. They only have to distribute the
modified source when binaries are released:

http://www.gnu.org/licenses/gpl-faq.html#GPLRequireSourcePostedPublic

-Andrew

Dzenan

unread,
Oct 12, 2013, 4:54:46 AM10/12/13
to opentripp...@googlegroups.com
Hi Andrew and Laurent,

of course I would like to integrate my source code into OTP but initially I need my master thesis to be finished and graded. Subsequently, I am willing to contribute to your approaches and aim to collaborate. I want to perfom docoral studies to work on my topic and thus, I should be able to contribute later on. My main target is to create a profile for electic wheelchair users and alter the routing procedure to fit my needs. The focus is on energy efficient routing.

Greetings,
Dzenan 

On Friday, October 11, 2013 7:27:15 PM UTC+2, Andrew Byrd wrote:
Reply all
Reply to author
Forward
0 new messages