-
Notifications
You must be signed in to change notification settings - Fork 321
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
byte[] array unpack error #476
Comments
Could you give me the followings?
|
MsgPackUtil.java`package com.comtop.dbaas.util; import com.fasterxml.jackson.core.JsonProcessingException; import java.io.IOException; public class MsgPackUtil {
} |
@komamitsu |
I'm not sure if msgpack-c is compatible with msgpack-java:0.8.
This information would be helpful to know that. |
msgpack-java:0.7+ incompatible msgpack-c, depended on an internal order of Java class's variables but msgpack-java:0.6 have a big bug issues #447 how unpack msg form c++/c by java? |
# java POJO
`public class ReportHeadParam {
}`
# data from rabbitmq
`
byte[] s = (byte[]) helper.decodeMessage(message);
ReportHeadParam head = MsgPackUtil.toObject(s, ReportHeadParam.class);`
# output error message
com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize a POJO (of type com.comtop.dbaas.monitor.dto.ReportInstanceStateParam) from non-Array representation (token: VALUE_NUMBER_INT): type/property designed to be serialized as JSON Array at [Source: (byte[])"?????mysql5.7?????mysql.ys.246.02???oNsAgef6?oNsAgef6-2?2018-05-17 11:30:01?ONLINE "; line: -1, column: 0] at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:63) at com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1342) at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1138) at com.fasterxml.jackson.databind.deser.impl.BeanAsArrayDeserializer._deserializeFromNonArray(BeanAsArrayDeserializer.java:365) at com.fasterxml.jackson.databind.deser.impl.BeanAsArrayDeserializer.deserialize(BeanAsArrayDeserializer.java:97) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4001) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3079) at com.comtop.dbaas.util.MsgPackUtil.toObject(MsgPackUtil.java:62) at com.comtop.dbaas.worker.mq.RabbitmqConfig$2.onMessage(RabbitmqConfig.java:269)
The text was updated successfully, but these errors were encountered: