Java Generic Command for EventSource Actor : Jackson serialization

Hi, I am using Jackson serialization for all the actor message communication. The configuration is working fine, but the message is de-serialize into a Scala Hashmap instead of the right type:

Below is my command class hierarchy :

public interface Command extends JacksonSerializable {
public class ActorCommand<T> implements Command {
    final ActorRef<?> replyTo;
    final T t;

    public ActorCommand(T t, ActorRef<?> replyTo){
        this.t = t;
        this.replyTo = replyTo;
public class InitActor<InitMessage> extends ActorCommand<InitMessage> {
    public InitActor(InitMessaget, ActorRef<?> replyTo) {
        super(t, replyTo);
} has data which has to read and acted upon.
I end up with below error when this message is de-serialize on another actor
In my actor :

private Effect<Event, State> initializeActor(State state, InitActor cmd) {
    InitActor<InitMessage> command = cmd;
    InitMessage mesg = command.getT();

Below is the error I see:

java.lang.ClassCastException: class scala.collection.immutable.HashMap cannot be cast to class com.model.InitMessage 
(scala.collection.immutable.HashMap and com.model.InitMessage are in unnamed module of loader 'app')

Essentially, “T” in my ActorCommand is converted to HashMap.
Appreciate any help here.