-
Notifications
You must be signed in to change notification settings - Fork 828
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
JavaSerialiazation error with primitive types #922
Comments
@techexplorer0310: Could you please create reproducer for this issue? |
I briefly looked into this and it looks like that If you can't reproduce this issue in a simple test, could you register you own protected Class resolveClass (ObjectStreamClass type) {
try {
return Class.forName(type.getName(), false, kryo.getClassLoader());
} catch (ClassNotFoundException ignored) {
// ignored
}
try {
return super.resolveClass(type);
} catch (ClassNotFoundException ex) {
throw new KryoException("Class not found: " + type.getName(), ex);
} catch (IOException ex) {
throw new KryoException("Could not load class: " + type.getName(), ex);
}
} |
Should be fixed. Please verify against the latest SNAPSHOT. |
When we use JavaSerialization and if the object being serialized has primitive fields like int, char etc then we can ClassNotFoundException for int.class. Earlier ObjectInputStream was used to resolveClass which was handling this.
In the latest version ObjectInputStreamWithKryoClassLoader is used which does not handle this
To Reproduce
Use java serialization and read an object which has int field type.
Environment:
The text was updated successfully, but these errors were encountered: