Reading workItemByteArray to recreate WorkItem from WorkItemInfo table on MariaDB leads to UTFDataFormatException

9 views
Skip to first unread message

alex winx

unread,
Apr 2, 2023, 1:34:25 PM4/2/23
to jBPM Setup
EntitySetup:

@Column(name = "workItemByteArray",columnDefinition = "LONGBLOB")
@Lob()
//@Convert(converter = ByteArrayToStringConverter.class)
private byte workItemByteArray;

ByteArrayInputStream binaryStream=new ByteArrayInputStream(bytes);
MarshallingConfigurationImpl marshallingConfigurationImpl = null;

marshallingConfigurationImpl = new MarshallingConfigurationImpl(new ObjectMarshallingStrategy[]{new SerializablePlaceholderResolverStrategy(ClassObjectMarshallingStrategyAcceptor.DEFAULT)}, false, false);

ObjectMarshallingStrategyStore objectMarshallingStrategyStore = marshallingConfigurationImpl.getObjectMarshallingStrategyStore();
ProtobufMarshallerReaderContext context;
WorkItem workItem=null;

try {

context = new ProtobufMarshallerReaderContext(binaryStream, null, null, objectMarshallingStrategyStore, null, null);

workItem = ProtobufInputMarshaller.readWorkItem(context);//try version1
workItem = InputMarshaller.readWorkItem(context);//try version2
//failed 

} catch (Exception e) {
e.printStackTrace();
}





Reply all
Reply to author
Forward
0 new messages