-
Notifications
You must be signed in to change notification settings - Fork 207
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
Oort data is not deserialized starting from 5.0.5 #1037
Comments
@zaynetro I can't think of a precise change that could cause this issue. There have been changes to the JSON parser/generator but we do have tests that prove that serialization in Oort works fine: If you can reproduce the issue will be great. Bear in mind that you have to setup the custom converter in 3 places: in the server (for Oort), in Oort (for OortComet, for inter-oort communication), and in the remote clients. |
OK after some further inspection I was able to repro one issue: Object is not deserialized in a custom In cometd 5.0.4 we get
but with 5.0.5 the object is not deserialized
The OortList seems to be working in this example but with 5.0.5 there is a warning log entry that is not present with 5.0.4:
We configure custom JSON context in two places:
What would be a third place to set the converter up for OortService to work? |
Actually, I can now see the same error with OortList in 5.0.5 when pushing more items to the queue: zaynetro/cometd-json-issue@7990f3f
|
@zaynetro thanks for the reproducer! The issue is due to jetty/jetty.project#6287. The workaround is to, for now, disable the WebSocket transport among Oort nodes, and use the HTTP transport instead. This can be done using I tried your reproducer with the HTTP transport and it works fine. |
Thanks for the deep investigation! It is definitely way beyond my level of understanding how things work. |
@zaynetro another workaround is to use the Along these lines: class QueuedChatJsonConvertor implements Convertor {
@Override
public void toJSON(Object obj, Output out) {
// Do not do this line.
// out.addClass(obj.getClass()); // Adds the "class" field.
// Do this line instead.
out.add("x-class", obj.getClass()); // Adds the "x-class" field.
...
}
} |
@zaynetro we have a fix in mainline Would you be able to build Jetty 9.4.42-SNAPSHOT, use that as a dependency on CometD, build CometD 5.0.8-SNAPSHOT, and try out if the fix works for you? I know it's a long shot, but would be great if you can -- no pressure though. |
Thanks for the tips! Unfortunately, I don't have much time to test this at the moment. |
Improved WebAppTest to test custom JSON serialization. Issue is fixed by upgrading to Jetty 9.4.42. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
The issue is fixed with the upgrade to Jetty 9.4.42. |
Improved WebAppTest to test to be similar to CometD 6. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Fixed WebAppTest to work with Java 8, where few classes come from the JDK. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Seems to be working fine now. Thank you! |
We are migrating from 5.0.2 to 5.0.7.
Where Cometd server and client context have the same implementation:
and the actual convertor:
Then we start an
OortList<QueuedChat>
and use it across nodes in the oort cluster. Everything is working well in 5.0.2 but with 5.0.7 we get a lot of:Upon closer inspection our
QueuedChatJsonConvertor.fromJSON
is never called with 5.0.7 release. While it was called fromJSON.parseObject
before the update. The data that other node receives includes the "class" field with the correct class name but the converter is not called anyway.The only change we are trying is cometd upgrade from 5.0.2 to 5.0.7 and jetty upgrade from 9.4.33.v20201020 to 9.4.40.v20210413. Plus the converter change but with or without the converter change the end result remains the same.
P.S I will try to prepare a test project tomorrow unless you won't suggest what might be wrong here before that.
UPD: Seems like exceptions happen only starting from 5.0.5 release.
The text was updated successfully, but these errors were encountered: