You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had searched in the issues and found no similar issues.
Version
0.5.0
Component(s)
Java
Minimal reproduce step
I have the following code:
//Fury Configuration
public static ThreadSafeFury fury = new ThreadLocalFury(classLoader -> {
Fury f = Fury.builder()
.requireClassRegistration(false)
.withRefTracking(true)
.withAsyncCompilation(true)
.withCompatibleMode(CompatibleMode.SCHEMA_CONSISTENT)
.withJdkClassSerializableCheck(false)
.withLanguage(Language.JAVA).withClassLoader(classLoader).build();
f.register(CircularFifoQueue.class);
// Function
public T get(String key) {
try {
return (T) fury.deserialize(bytes);
} catch (Exception ex) {
logger.error("Error deserializing object", ex);
return null;
}
}
... later
Queue<Long> result = get(...);
What did you expect to see?
Fury should throw Exception (which is what I am expecting when upgrading to new version and Fury failed to deserialize the byte[] from the old version) instead of silently deserialize the bytes into UnexistedClassSerializers$UnexistedSkipClass
What did you see instead?
It works fine in Fury 0.4.1, but since I upgraded to 0.5.0, my app throws the following errors:
java.lang.ClassCastException: class org.apache.fury.serializer.UnexistedClassSerializers$UnexistedSkipClass cannot be cast to class java.util.Queue (org.apache.fury.serializer.UnexistedClassSerializers$UnexistedSkipClass is in unnamed module of loader org.springframework.boot.loader.launch.LaunchedClassLoader @1d56ce6a; java.util.Queue is in module java.base of loader 'bootstrap')
Anything Else?
If it is expected behavior, where should I look at in the documentation.
What should I do instead? Is there any configuration I can change to make it throw Exception instead of returning UnexistedSkipClass
Are you willing to submit a PR?
I'm willing to submit a PR!
The text was updated successfully, but these errors were encountered:
Hi @cdxf , thanks for reporting this issue. It seems that you use newer version of Fury to deserialize data from old version Fury. Fury read a class id for UnexistedSkipClass, so it throw such exception.
This registered class id may be used by other class in older Fury, it's possible to read it as UnexistedSkipClass, which is the error you see. I can submit a PR to skip register UnexistedSkipClass, but if you use newer Fury to deserialize older Fury, you will still see other strange error. Currently we didn' provide binary compatibility. Such compatibility will be provided in the future, but not now. Could you try https://fury.apache.org/docs/guide/java_object_graph_guide#upgrade-fury to upgrade Fury?
## What does this PR do?
skip register unexisted skip class if `deserializeUnexistedClass` not
enabled
## Related issues
#1600
## Does this PR introduce any user-facing change?
<!--
If any user-facing interface changes, please [open an
issue](https://github.com/apache/incubator-fury/issues/new/choose)
describing the need to do so and update the document if necessary.
-->
- [ ] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?
## Benchmark
<!--
When the PR has an impact on performance (if you don't know whether the
PR will have an impact on performance, you can submit the PR first, and
if it will have impact on performance, the code reviewer will explain
it), be sure to attach a benchmark data here.
-->
Search before asking
Version
0.5.0
Component(s)
Java
Minimal reproduce step
I have the following code:
What did you expect to see?
Fury should throw Exception (which is what I am expecting when upgrading to new version and Fury failed to deserialize the byte[] from the old version) instead of silently deserialize the bytes into UnexistedClassSerializers$UnexistedSkipClass
What did you see instead?
It works fine in Fury 0.4.1, but since I upgraded to 0.5.0, my app throws the following errors:
Anything Else?
If it is expected behavior, where should I look at in the documentation.
What should I do instead? Is there any configuration I can change to make it throw Exception instead of returning UnexistedSkipClass
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: