Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
VoidK2 opened this issue Feb 19, 2020 · 14 comments
Labels

Comments

@VoidK2
Copy link

VoidK2 commented Feb 19, 2020

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`

@easbar easbar added the bug label Feb 19, 2020
@easbar
Copy link
Member

easbar commented Feb 19, 2020

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?

@easbar easbar changed the title Quick Start Guide for Developers Command line arguments in graphhopper.sh not working with current config-example.yml Feb 19, 2020
@VoidK2
Copy link
Author

VoidK2 commented Feb 19, 2020

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)

@VoidK2
Copy link
Author

VoidK2 commented Feb 19, 2020

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

@easbar
Copy link
Member

easbar commented Feb 19, 2020

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.

@VoidK2
Copy link
Author

VoidK2 commented Feb 19, 2020

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)

@karussell
Copy link
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?

@easbar
Copy link
Member

easbar commented Feb 19, 2020

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/

@easbar
Copy link
Member

easbar commented Feb 19, 2020

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

@JeongJun-Lee
Copy link

same here. I tried it on 0.13 brach

@karussell
Copy link
Member

karussell commented Feb 28, 2020

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

@JeongJun-Lee
Copy link

JeongJun-Lee commented Feb 28, 2020

@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

@karussell
Copy link
Member

It is master you need the documentation of 0.13: https://github.com/graphhopper/graphhopper/blob/0.13/reader-gtfs/README.md#quick-start

@JeongJun-Lee
Copy link

@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.

@karussell
Copy link
Member

karussell commented Mar 30, 2020

@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
Labels
Projects
None yet
Development

No branches or pull requests

4 participants