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
Wrong Serialization (CompatibleFieldSerializer) #556
Comments
Anybody has any information about this bug? @NathanSweet This problem occurs in production |
Hey guys Someone can you help me? |
@oassuncao It would help if you could further reduce the sample, following the ideas of http://www.sscce.org. |
@magro This is a reduced example of the original code, I could only reproduce this error with this composition classes and values If I remove a field of the POJO, the error does not occurs more Please try to help me, I have this problem in the production environment |
Can you remove as many as classes as possible to see where/when the error starts to occur? |
I removed all classes as possible, If I remove any other class, the error does not occur |
Ok, I analyzed this and could track it down to the |
Thank you @magro for you support Check if you remove the "aggregations" data on data.json, the problem not occur more {
"suppliers": [
{
"nature": "LegalEntity",
"documents": [
{
"value": "42216103000133",
"type": {
"type": "LegalEntity"
}
}
]
}
]
} |
Yes, it's caused by the |
More findings: because the |
@oassuncao D'oh, after all that digging I just found that this issue had actually been analyzed and discussed in the past - see #286 (comment). And in fact it's also documented in CompatibleFieldSerializer and the README. If you follow the discussion and links you'll see that this is not easily being solved. Can you for now disable referenced to get this solved? Not sure if / when there's a solution for this. |
Hi @magro, If I disable the references, the problem is resolved I will try use this solution for now |
I use kryo to serialize information between my systems, but I've some problems when some fields not exists in the class when I read the values. I created a project to simulate the problem (kryotest.zip)
I created a class named
DefaultClassResolver
only to change the Class Types and simulate other system and other classes with the same structureI have the original classes in the package
kryo.test.SupplierInitial
and the classes of other system in the packagekryo.test.SupplierWrapper
If run the app without any change the output is "Wrong", because the nature field receive the value of the link field, this occurs because the class
SupplierAggregationME
in the package kryo.test.SupplierInitial has 2 fields (value and total) and in the classSupplierAggregationME
of package kryo.test.SupplierWrapper have only one field total.If you uncomment the field value, getter and setter of class kryo.test.SupplierWrapper.SupplierAggregationME, the problem doesn't occur, The output is "Correct"
This is only an example, if you comment all fields (getter and setter) of the SupplierME classes (SupplierInitial and SupplierWrapper packages) you can verify the nature field receive the value of name field
kryotest.zip
The text was updated successfully, but these errors were encountered: