Unrecognized field "Labels" (class com.github.dockerjava.api.model.ServiceSpec)
See original GitHub issueHi everyone
After executing dockerClient.listServicesCmd().exec();
the following exception occurs.
Docker Version: 17.06.2-ce-mac27 (19124) Docker-Java Version: 3.1.0-SNAPSHOT
Thank you very much for your help!
ERROR com.github.dockerjava.core.async.ResultCallbackTemplate - Error during callback
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "Labels" (class com.github.dockerjava.api.model.ServiceSpec), not marked as ignorable (6 known properties: "EndpointSpec", "Mode", "Networks", "Name", "TaskTemplate", "UpdateConfig"])
at [Source: [B@70967e7a; line: 1, column: 193] (through reference chain: java.util.ArrayList[0]->com.github.dockerjava.api.model.Service["Spec"]->com.github.dockerjava.api.model.ServiceSpec["Labels"])
at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:62)
at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:834)
at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:1093)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1478)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1456)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:282)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:140)
at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:504)
at com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:111)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:276)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:140)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:287)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:259)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:26)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3798)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2944)
at com.github.dockerjava.netty.handler.JsonResponseCallbackHandler.channelRead0(JsonResponseCallbackHandler.java:40)
at com.github.dockerjava.netty.handler.JsonResponseCallbackHandler.channelRead0(JsonResponseCallbackHandler.java:17)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
...
Update 1: I just tried the Pull Request mentioned by @orzeh , the exception from above is gone. The following new exception occurs.
java.util.ArrayList[0]->com.github.dockerjava.api.model.Service["Spec"]->com.github.dockerjava.api.model.ServiceSpec["TaskTemplate"]->com.github.dockerjava.api.model.TaskSpec["Placement"]->com.github.dockerjava.api.model.ServicePlacement["Platforms"])
at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:62)
at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:834)
at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:1093)
Update 2: Here is another UnrecognizedPropertyException when calling dockerClient.inspectServiceCmd(...).exec();
.
Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "PublishMode" (class com.github.dockerjava.api.model.PortConfig), not marked as ignorable (4 known properties: "Protocol", "TargetPort", "Name", "PublishedPort"])
at [Source: [B@1e9fa6b4; line: 1, column: 503] (through reference chain: com.github.dockerjava.api.model.Service["Spec"]->com.github.dockerjava.api.model.ServiceSpec["EndpointSpec"]->com.github.dockerjava.api.model.EndpointSpec["Ports"]->java.util.ArrayList[0]->com.github.dockerjava.api.model.PortConfig["PublishMode"])
at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:62)
at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:834)
at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:1093)
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Object mapper readValueAsString with a ServiceSpec that ...
UnrecognizedPropertyException: Unrecognized field "mode" (class com.github.dockerjava.api.model.ServiceModeConfig), not marked as ignorable ...
Read more >Same dependencies and java code, but use Gradle will start ...
Same dependencies and java code, but use Gradle will start fail with: Unrecognized field "ID" (class com.github.dockerjava.api.model.
Read more >Unrecognized field "stream" · Issue #321 · docker-java ... - GitHub
UnrecognizedPropertyException: Unrecognized field "stream" (class com.github.dockerjava.api.model.PullResponseItem), not marked as ignorable (6 known ...
Read more >com.github.docker-java is not shaded and conflicts with the ...
UnrecognizedPropertyException: Unrecognized field "ID" (class com.github.dockerjava.api.model.Info), not marked as ignorable (48 known ...
Read more >docker-java/ServiceSpec.java at master - GitHub
Java Docker API Client. Contribute to docker-java/docker-java development by creating an account on GitHub.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @fengxx Don’t you think it would be a good idea to add
@JsonIgnoreProperties(ignoreUnknown = true)
to all entities respectively to a base entity?This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.