I'd like to use ProtoStream for serialization between Client and Server Infinispan. So I annotated the classes with @ProtoMessage and @ProtoField to generate the proto file and the marshallers.
I also tried to use @UnknownFieldSet to handle data model changes. But I've got the following error when the client with version 1 read the data written by the client version 2 (one field is added in version 2)
java.lang.IllegalAccessError: tried to access class org.infinispan.protostream.impl.UnknownFieldSetImpl from class test.Book$___ProtostreamGeneratedMarshaller2
Do you have any idea if this is a bug or if I didn't understand how to use @UnknownFieldSet.
FYI, I used Infinispan 9.4.4 and ProtoStream 4.2.2.
I activated level Trace to have the code of the generated marshaller and I found:
org.infinispan.protostream.UnknownFieldSet u = o.getUnknown();
if (u == null) u = new org.infinispan.protostream.impl.UnknownFieldSetImpl();
if (!u.readSingleField(tag, $2)) done = true;
if (!u.isEmpty()) o.setUnknown(u);
The error is clear, the class UnknownFieldSetImpl is not public.
Thanks Lionel for reporting this! It is indeed a bug, I've reported it here [IPROTO-77] UnknownFieldSetImpl should be public so generated marshallers can access it - JBoss Issue Tracker and the fix is in github now on 4.2.x and master. I'll also release 4.2.3.Final with this fix today but it will sync to maven-central only tomorrow.