Comments (6)
I suppose what @lvitaly means is: ArraysAsListSerializer is currently not compatible with Java 17, as a java.lang.reflect.InaccessibleObjectException is thrown when the class is created. This is no longer allowed:
public ArraysAsListSerializer() {
_arrayField = Class.forName( "java.util.Arrays$ArrayList" ).getDeclaredField( "a" );
_arrayField.setAccessible( true );
}
Are there any plans to fix this?
from kryo-serializers.
Sorry that I opened an issue without comment. @jvdvegt, I guess you are right, but I discovered that kryo added this serializer to the default list in v5.0.0 (see Kryo.java#L225).
I discovered few more serializers that throw errors with JDK 17
- UnmodifiableCollectionsSerializer
- SynchronizedCollectionsSerializer
Unfortunately, I didn't dig deep enough to find out the root cause, and here is an original thread with these issues in cqengine project (see npgall/cqengine#269). You can find there that almost all cqengine's tests except one (ReflectiveAttributeTest) are passing with JDK17 + kryo v5.2.0 without serializers mentioned above.
from kryo-serializers.
The first one seems quite easy to fix, though it is slightly slower than the original version. See attached sourcecode.
UnmodifiableCollectionsSerializer.java.txt
from kryo-serializers.
Stumbled across the issue with the UnmodifiableCollectionsSerializer
when I was trying JDK 17 with kryo + kryo-serializers.
The stacktrace is:
checkCanSetAccessible:354, AccessibleObject (java.lang.reflect)
checkCanSetAccessible:297, AccessibleObject (java.lang.reflect)
checkCanSetAccessible:178, Field (java.lang.reflect)
setAccessible:172, Field (java.lang.reflect)
<clinit>:55, UnmodifiableCollectionsSerializer (de.javakaffee.kryoserializers)
The error message is:
Unable to make field final java.util.Collection java.util.Collections$UnmodifiableCollection.c accessible: module java.base does not "opens java.util" to unnamed module @61322f9d
from kryo-serializers.
Any updates on ArraysAsListSerializer compatibility with JDK 17?
from kryo-serializers.
@tinder-johnbuhanan: Can't you simply use the built-in ArraysAsListSerializer from Kryo 5? If you are on Kryo 5, you don't need any custom serializers. If you are on Kryo 4, you can copy the ArraysAsListSerializer
from Kryo 5.
from kryo-serializers.
Related Issues (20)
- Compatibility with JDK 10 HOT 1
- serializer for org.hibernate.proxy.HibernateProxy HOT 3
- Compatibility with open JDK 11 HOT 1
- Collections.SetFromMap gives null pointer exception in deserialization. HOT 2
- For Kryo-serializers 0.45, I see there is compatibility issue for with java 11.
- Unable to use SubListSerializers with JDK9 HOT 2
- Fail to deserialize lists created from guava's immutableCollection.asList()
- pulls in kryo v5 even though its supposed to be 4 HOT 1
- ImmutableMultimapSerializer does not properly handle EmptyImutableSetMultimap
- Another release depending on kryo-shaded 4.0.2 HOT 3
- 0.45.1 release? HOT 6
- Can't use version 0.45 with JDK11 if i have generics in my code
- Kryo exception for com.google.common.collect.RegularImmutableBiMap
- Kryo v5 support HOT 10
- Support for Ion data type HOT 1
- Does kryo have a way to support bean adding and deleting fields
- Add support for missing Guava immutable types
- Is this repo still mantained? HOT 9
- Could not access source collection field in java.util.Collections$UnmodifiableCollection
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kryo-serializers.