Querying the vault from the shell for a class using UniqueIdentifier results in a serialisation error:
Fri May 03 06:57:55 UTC 2019>>> run vaultQuery contractStateType: com.marketplace.catalyst.states.AssetState
RPC failed: java.lang.IllegalStateException: Jackson didn't provide serialisers for [linearID]
Sample AssetState class:
@BelongsToContract(AssetContract.class)
@CordaSerializable
public class AssetState implements LinearState,ContractState {
private final UniqueIdentifier linearID;
private final Asset asset;
private final Party creator;
private final Party marketplace;
private final Party regulator;
@ConstructorForDeserialization
public AssetState(Asset asset, UniqueIdentifier linearID, Party creator, Party marketplace, Party regulator) {
this.asset = asset;
this.linearID = linearID;
this.creator = creator;
this.marketplace = marketplace;
this.regulator = regulator;
}
public Asset getAsset() {
return asset;
}
public Party getCreator() {
return creator;
}
public Party getMarketplace() {
return marketplace;
}
public Party getRegulator() {
return regulator;
}
@NotNull
@Override
public List<AbstractParty> getParticipants() {
return ImmutableList.of(creator, marketplace, regulator);
}
@NotNull
@Override
public UniqueIdentifier getLinearId() {
return this.linearID;
}
}