square/keywhiz

Dev CLI fails to list groups - Cannot instantiate value of type java.time.OffsetDateTime

Closed this issue · 1 comments

I was able to successfully build the server and the CLI using the instructions provided on the homepage, but when I run the CLI to see if things work, I get an error:

$ ./cli/target/keywhiz-cli-*-SNAPSHOT-shaded.jar --devTrustStore --user keywhizAdmin list groups
Server URL not specified (--url flag), assuming https://localhost:4444/
Exception in thread "main" java.lang.RuntimeException: com.fasterxml.jackson.databind.JsonMappingException: Can not instantiate value of type [simple type, class java.time.OffsetDateTime] from String value ('2012-06-21T14:38:09.000Z'); no single-String constructor/factory method
 at [Source: [{"id":916,"name":"Blackops","description":"","createdAt":"2012-06-21T14:38:09.000Z","createdBy":"","updatedAt":"2012-06-21T14:38:09.000Z","updatedBy":""},{"id":917,"name":"Security","description":"","createdAt":"2012-06-21T14:38:09.000Z","createdBy":"","updatedAt":"2012-06-21T14:38:09.000Z","updatedBy":""},{"id":918,"name":"Web","description":"","createdAt":"2012-06-21T14:38:09.000Z","createdBy":"","updatedAt":"2012-06-21T14:38:09.000Z","updatedBy":""},{"id":919,"name":"iOS","description":"","createdAt":"2012-06-21T14:38:09.000Z","createdBy":"","updatedAt":"2012-06-21T14:38:09.000Z","updatedBy":""},{"id":920,"name":"DeprecatedGroup","description":"","createdAt":"2013-03-12T11:23:43.000Z","createdBy":"","updatedAt":"2013-03-12T11:23:43.000Z","updatedBy":""}]; line: 1, column: 46] (through reference chain: java.util.ArrayList[0]->keywhiz.api.model.Group["createdAt"])
        at com.google.common.base.Throwables.propagate(Throwables.java:160)
        at keywhiz.cli.commands.ListAction.run(ListAction.java:71)
        at keywhiz.cli.CommandExecutor.executeCommand(CommandExecutor.java:137)
        at keywhiz.cli.CliMain.main(CliMain.java:68)
Caused by: com.fasterxml.jackson.databind.JsonMappingException: Can not instantiate value of type [simple type, class java.time.OffsetDateTime] from String value ('2012-06-21T14:38:09.000Z'); no single-String constructor/factory method
 at [Source: [{"id":916,"name":"Blackops","description":"","createdAt":"2012-06-21T14:38:09.000Z","createdBy":"","updatedAt":"2012-06-21T14:38:09.000Z","updatedBy":""},{"id":917,"name":"Security","description":"","createdAt":"2012-06-21T14:38:09.000Z","createdBy":"","updatedAt":"2012-06-21T14:38:09.000Z","updatedBy":""},{"id":918,"name":"Web","description":"","createdAt":"2012-06-21T14:38:09.000Z","createdBy":"","updatedAt":"2012-06-21T14:38:09.000Z","updatedBy":""},{"id":919,"name":"iOS","description":"","createdAt":"2012-06-21T14:38:09.000Z","createdBy":"","updatedAt":"2012-06-21T14:38:09.000Z","updatedBy":""},{"id":920,"name":"DeprecatedGroup","description":"","createdAt":"2013-03-12T11:23:43.000Z","createdBy":"","updatedAt":"2013-03-12T11:23:43.000Z","updatedBy":""}]; line: 1, column: 46] (through reference chain: java.util.ArrayList[0]->keywhiz.api.model.Group["createdAt"])
        at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:148)
        at com.fasterxml.jackson.databind.DeserializationContext.mappingException(DeserializationContext.java:875)
        at com.fasterxml.jackson.databind.deser.ValueInstantiator._createFromStringFallbacks(ValueInstantiator.java:281)
        at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.createFromString(StdValueInstantiator.java:284)
        at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromString(BeanDeserializerBase.java:1176)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:143)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:134)
        at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:3674)
        at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:1996)
        at com.fasterxml.jackson.core.JsonParser.readValueAs(JsonParser.java:1506)
        at keywhiz.api.ApiDate$ApiDateDeserializer.deserialize(ApiDate.java:50)
        at keywhiz.api.ApiDate$ApiDateDeserializer.deserialize(ApiDate.java:47)
        at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:520)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeWithErrorWrapping(BeanDeserializer.java:461)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:376)
        at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1099)
        at com.fasterxml.jackson.module.afterburner.deser.SuperSonicBeanDeserializer.deserializeFromObject(SuperSonicBeanDeserializer.java:196)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:131)
        at com.fasterxml.jackson.module.afterburner.deser.SuperSonicBeanDeserializer.deserialize(SuperSonicBeanDeserializer.java:117)
        at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245)
        at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:217)
        at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:25)
        at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3702)
        at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2733)
        at keywhiz.client.KeywhizClient.allGroups(KeywhizClient.java:124)
        at keywhiz.cli.commands.ListAction.run(ListAction.java:56)
        ... 2 more

Fixed in 919939f