-
Notifications
You must be signed in to change notification settings - Fork 9
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
Occur exception using sitewhere-java-client api #28
Labels
bug
Something isn't working
Comments
We made some changes to the APIs around the 2.1 release and the Java client library may have been out of sync with the updates. We will take a look at the issue and try to find a workaround. |
@githubin80 I'm moving this issue to |
jorgevillaverde-sitewhere
added a commit
that referenced
this issue
Mar 11, 2020
jorgevillaverde-sitewhere
added a commit
that referenced
this issue
Mar 11, 2020
@githubin80 we have release |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I use sitewhere-java-client api ,occur the following exceptions:
ISiteWhereClient.getDeviceByToken(tenantAuthentication, devicetoken)
Exception in thread "main" com.sitewhere.spi.SiteWhereException: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "asset" (class com.sitewhere.rest.model.device.DeviceAssignment), not marked as ignorable (15 known properties: "areaId", "updatedDate", "deviceTypeId", "metadata", "deviceId", "updatedBy", "activeDate", "createdDate", "token", "id", "createdBy", "assetId", "status", "customerId", "releasedDate"]) at [Source: (okhttp3.ResponseBody$BomAwareReader); line: 1, column: 1013] (through reference chain: com.sitewhere.rest.model.device.marshaling.MarshaledDevice["activeDeviceAssignments"]->java.util.ArrayList[0]->com.sitewhere.rest.model.device.DeviceAssignment["asset"]) at com.sitewhere.rest.client.SiteWhereClient.processRestCall(SiteWhereClient.java:2469) at com.sitewhere.rest.client.SiteWhereClient.getDeviceByToken(SiteWhereClient.java:1953) at com.techtotop.device.domain.TestSitewhereClient.getDevice(TestSitewhereClient.java:172) at com.techtotop.device.domain.TestSitewhereClient.main(TestSitewhereClient.java:75) Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "asset" (class com.sitewhere.rest.model.device.DeviceAssignment), not marked as ignorable (15 known properties: "areaId", "updatedDate", "deviceTypeId", "metadata", "deviceId", "updatedBy", "activeDate", "createdDate", "token", "id", "createdBy", "assetId", "status", "customerId", "releasedDate"]) at [Source: (okhttp3.ResponseBody$BomAwareReader); line: 1, column: 1013] (through reference chain: com.sitewhere.rest.model.device.marshaling.MarshaledDevice["activeDeviceAssignments"]->java.util.ArrayList[0]->com.sitewhere.rest.model.device.DeviceAssignment["asset"]) at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:61) at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:840) at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:1206) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1592) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1570) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:294) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129) 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.ObjectReader._bindAndClose(ObjectReader.java:1719) at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1244) at retrofit2.converter.jackson.JacksonResponseBodyConverter.convert(JacksonResponseBodyConverter.java:32) at retrofit2.converter.jackson.JacksonResponseBodyConverter.convert(JacksonResponseBodyConverter.java:23) at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:223) at retrofit2.OkHttpCall.execute(OkHttpCall.java:186) at com.sitewhere.rest.client.SiteWhereClient.processRestCall(SiteWhereClient.java:2462) ... 3 more
And the api ISiteWhereClient.updateDevice(tenantAuthentication, "testtoken", deviceRequest) has the same exception. Once the device has DeviceAssignment to assert, the exception appears.
SiteWhere version 2.1.0, and sitewhere-java-client version 2.1.x and 2.2.0.
The text was updated successfully, but these errors were encountered: