julianhowarth commented on issue #2275:
URL: https://github.com/apache/fory/issues/2275#issuecomment-3183408493
I'm hitting this same error case, let me provide some details in case it
provides some clues - I have a object model of around 150 classes (so not easy
to provide a reproducer) but nothing too complex, no cycles and no custom
serializers etc.
If I use:
```java
Fory.builder()
.withLanguage(Language.JAVA)
.requireClassRegistration(false)
.build();
```
then I can serialize and deserialize my object graph perfectly. However,
once I switch to:
```java
Fory.builder()
.withLanguage(Language.JAVA)
.requireClassRegistration(false)
.withCompatibleMode(CompatibleMode.COMPATIBLE)
.build();
```
then I see the error above, though with a slightly different stack:
```
java.lang.NullPointerException: Cannot read field "serializer" because
"classInfo" is null
at
org.apache.fory.resolver.ClassResolver.getOrUpdateClassInfo(ClassResolver.java:1322)
at
org.apache.fory.resolver.ClassResolver.readClassInfoWithMetaShare(ClassResolver.java:1568)
at
org.apache.fory.resolver.ClassResolver.readClassInfo(ClassResolver.java:1879)
at
com.endeavorstreaming.vesper.content_engine.common.domain.video.VideoForyCodecMetaShared1_0.readFields1$(VideoForyCodecMetaShared1_0.java:169)
at
com.endeavorstreaming.vesper.content_engine.common.domain.video.VideoForyCodecMetaShared1_0.read(VideoForyCodecMetaShared1_0.java:766)
at
com.endeavorstreaming.vesper.content_engine.common.load.RealmContentItemForyCodecMetaShared0_0.read(RealmContentItemForyCodecMetaShared0_0.java:48)
at org.apache.fory.Fory.readDataInternal(Fory.java:1055)
at org.apache.fory.Fory.readNonRef(Fory.java:978)
```
Digging in a bit with a debugger I see that `registeredId2ClassInfo` array
in `ClassResolver` has 190 elements, of which 29 are `null`. The `classId`
supplied to `getOrUpdateClassInfo` is `0` which is one of the null elements.
I'm using Fory `0.11.2` on Java 21.0.8 on Fedora linux.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]