Skip to content

Command line arguments in graphhopper.sh not working with current config-example.yml #1921

Closed

Description

@VoidK2

when i first run ./graphhopper.sh -a web -i europe_germany_berlin.pbf on my windows10 ,it is come out.

`io.dropwizard.configuration.ConfigurationParsingException: config.yml has an error:

  • Failed to parse configuration at: graphhopper.graph; Cannot deserialize instance of java.lang.String out of START_OBJECT token
    at [Source: UNKNOWN; line: -1, column: -1] (through reference chain: com.graphhopper.http.GraphHopperServerConfiguration["graphhopper"]->java.util.LinkedHashMap["graph"])

    at io.dropwizard.configuration.ConfigurationParsingException$Builder.build(ConfigurationParsingException.java:279)
    at io.dropwizard.configuration.BaseConfigurationFactory.build(BaseConfigurationFactory.java:156)
    at io.dropwizard.configuration.BaseConfigurationFactory.build(BaseConfigurationFactory.java:89)
    at io.dropwizard.cli.ConfiguredCommand.parseConfiguration(ConfiguredCommand.java:126)
    at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:74)
    at io.dropwizard.cli.Cli.run(Cli.java:78)
    at io.dropwizard.Application.run(Application.java:93)
    at com.graphhopper.http.GraphHopperApplication.main(GraphHopperApplication.java:34)
    

Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of java.lang.String out of START_OBJECT token
at [Source: UNKNOWN; line: -1, column: -1] (through reference chain: com.graphhopper.http.GraphHopperServerConfiguration["graphhopper"]->java.util.LinkedHashMap["graph"])
at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:63)
at com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1343)
at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1139)
at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1093)
at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:63)
at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:10)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer._readAndBindStringKeyMap(MapDeserializer.java:527)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:364)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:29)
at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:3984)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2300)
at com.fasterxml.jackson.core.JsonParser.readValueAs(JsonParser.java:1752)
at com.graphhopper.jackson.CmdArgsDeserializer.deserialize(CmdArgsDeserializer.java:21)
at com.graphhopper.jackson.CmdArgsDeserializer.deserialize(CmdArgsDeserializer.java:13)
at com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:138)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)
at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:3984)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2276)
at io.dropwizard.configuration.BaseConfigurationFactory.build(BaseConfigurationFactory.java:127)
... 6 more`

Activity

  1. easbar commented on Feb 19, 2020

    @easbar
    Member

    Thanks for reporting. If you want to get started, it would be best to use the latest stable release (0.13). The problem here is once again that dropwizard does not allow setting a missing (nested) property via the command line.

    Changing the beginning of config-example.yml to this:

    graphhopper:
    
      # OpenStreetMap input file
      datareader.file: ""
    
      # Local folder used by graphhopper to store data
      graph.location: tmp-gh

    should make it work also for current master. After you change config-example.yml you need to delete config.yml though (otherwise the changes will not be picked up by graphhopper.sh).

    @karussell Shall we modify config-example.yml as I suggested? Should we add a note to quick start docs that one should always use the latest stable release?

  2. changed the title [-]Quick Start Guide for Developers[/-] [+]Command line arguments in graphhopper.sh not working with current config-example.yml[/+] on Feb 19, 2020
  3. VoidK2 commented on Feb 19, 2020

    @VoidK2
    Author
    datareader.file: ""

    can not work with your reply ..ERROR io.dropwizard.cli.ServerCommand - Unable to start server, shutting down java.lang.IllegalStateException: Version of edges unsupported: 14, expected:15. Make sure you are using the same GraphHopper version for reading the files that was used for creating them. See https://discuss.graphhopper.com/t/722 at com.graphhopper.storage.StorableProperties.check(StorableProperties.java:184)

  4. VoidK2 commented on Feb 19, 2020

    @VoidK2
    Author

    but is worked with original qucikstart on my another computer(windows server 2016) ,but it is the same jdk,config_xml,osm_data

  5. easbar commented on Feb 19, 2020

    @easbar
    Member

    can not work with your reply ..ERROR io.dropwizard.cli.ServerCommand - Unable to start server, shutting down java.lang.IllegalStateException: Version of edges unsupported: 14, expected:15.

    Thats another error now. Make sure you delete the -gh folder (for example if you did not specify otherwise and used europe_germany_berlin.osm.pbf its probably named europe_germany_berlin-gh). GraphHopper does not support using an existing graph folder with a newer version (in case the format was changed in between versions). Thats also the reason it worked on your other computer: The graph folder probably did not already exist on that one.

  6. VoidK2 commented on Feb 19, 2020

    @VoidK2
    Author

    can not work with your reply ..ERROR io.dropwizard.cli.ServerCommand - Unable to start server, shutting down java.lang.IllegalStateException: Version of edges unsupported: 14, expected:15.

    Thats another error now. Make sure you delete the -gh folder (for example if you did not specify otherwise and used europe_germany_berlin.osm.pbf its probably named europe_germany_berlin-gh). GraphHopper does not support using an existing graph folder with a newer version (in case the format was changed in between versions). Thats also the reason it worked on your other computer: The graph folder probably did not already exist on that one.

    thanks for your help ,is worked! love you ! may i ask ,how to modify code with IDEA ? which folder should i import to idea?(just web service and a web page)

  7. karussell commented on Feb 19, 2020

    @karussell
    Member

    @karussell Shall we modify config-example.yml as I suggested?

    Yes, at least if this is still a problem for dropwizard. Or should we workaround it for these two properties?

    Should we add a note to quick start docs that one should always use the latest stable release?

    Hmmh, I think that the latest docs should always use master. But if you click on the stable 0.13 docs (here) you will get to the quick start that indicates switching to 0.13 branch, I think. But maybe something else needs improvement?

  8. easbar commented on Feb 19, 2020

    @easbar
    Member

    may i ask ,how to modify code with IDEA ?

    I would do File -> New... -> Project from existing sources ... and then choose the pom.xml file at the root of the graphhopper directory. If you have further usage related questions please use the forum at: https://discuss.graphhopper.com/

  9. easbar commented on Feb 19, 2020

    @easbar
    Member

    Yes, at least if this is still a problem for dropwizard. Or should we workaround it for these two properties?

    I think its a problem for dropwizard because the properties contain dots which indicate that there is a nested structure for dropwizard. For example using -Ddw.graphhopper.xyz works but something like -Ddw.graphhopper.graph.xyz requires the config file to contain a graph object under the graphhopper node...
    Workaround, you mean manually checking for the property? Ok yes we could do that, but it would be just that, a workaround :) If we really want to improve something maybe using property names without dots would be better? Is it too ugly to add 'meaningless' placeholders (like the empty datareader.file name and some default graphhopper folder name (just so it can be overwritten using command line))? We could even add an empty object and it should work: graphhopper.graph: {} .

    Hmmh, I think that the latest docs should always use master.

    ok

  10. added a commit that references this issue on Feb 21, 2020
    c384522
  11. JeongJun-Lee commented on Feb 28, 2020

    @JeongJun-Lee

    same here. I tried it on 0.13 brach

  12. karussell commented on Feb 28, 2020

    @karussell
    Member

    If you are on the 0.13 branch, please use this config file and command line parameters like e.g. -Dgraphhopper.graph.location=graph-cache (without the dw. prefix!).

    For 1.0 and later the usage can change. See the documentation in: https://github.com/graphhopper/graphhopper#get-started

  13. JeongJun-Lee commented on Feb 28, 2020

    @JeongJun-Lee

    @karussell When I removed the dw. prefix and used config for 0.13 version as your recommendation, the content of error is changed like below:

    java.lang.IllegalArgumentException: entry in encoder list not supported pt
    at com.graphhopper.routing.util.DefaultFlagEncoderFactory.createFlagEncoder(DefaultFlagEncoderFactory.java:60)

    Now I am trying to run GTFS by this guideline: https://github.com/graphhopper/graphhopper/blob/master/reader-gtfs/README.md#quick-start

  14. JeongJun-Lee commented on Feb 28, 2020

    @JeongJun-Lee

    @karussell sorry for that. The error(entry in encoder list not supported pt) would be happened when the gtfs.file option, -Dgraphhopper.gtfs.file=gtfs-vbb.zip was not included. For GTFS, the option looks like a mandatory.

  15. karussell commented on Mar 30, 2020

    @karussell
    Member

    @JeongJun-Lee Can you have a look if the suggested fix / workaround applies to your problems too? #1973

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions