Unable to resolve parameter 0 (CamundaActionEvent) in handler

I’m developing a plugin that will connect with axon server (not a spring boot application) , when I run the plugin I always got this error :
" Unable to resolve parameter 0 (CamundaActionEvent) in handler public void com.example.camundaplugin.aggregate.CamundaActionAggregate.on(com.example.camundaplugin.event.CamundaActionEvent)"

this is my Aggregate :

package com.example.camundaplugin.aggregate;

import com.example.camundaplugin.command.CamundaActionEventCmd;
import com.example.camundaplugin.event.CamundaActionEvent;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.axonframework.commandhandling.CommandHandler;
import org.axonframework.eventsourcing.EventSourcingHandler;
import org.axonframework.modelling.command.AggregateIdentifier;
import org.axonframework.modelling.command.AggregateLifecycle;
import org.axonframework.spring.stereotype.Aggregate;

import java.util.HashMap;
import java.util.UUID;

@AllArgsConstructor
@NoArgsConstructor
@Getter
@Aggregate
public class CamundaActionAggregate {
    @AggregateIdentifier
    private UUID id;
    private String eventType;
    private String initializer;
    private HashMap<String, String> variables;

    @CommandHandler
    public CamundaActionAggregate(CamundaActionEventCmd cmd){
        AggregateLifecycle.apply(new CamundaActionEvent(cmd.getId(), cmd.getEventType(), cmd.getInitializer(), cmd.getVariables()));
        System.out.println("help world!");

    }

    @EventSourcingHandler
    public void on(CamundaActionEvent event){
        this.id = event.getId();
        this.eventType = event.getEventType();
        this.initializer = event.getInitializer();
        this.variables = event.getVariables();

    }


}

and this is the CamundaActionEvent class :

package com.example.camundaplugin.event;

import lombok.Data;

import java.util.HashMap;
import java.util.UUID;

@Data
public class CamundaActionEvent {
    private final UUID id;
    private final String eventType;
    private final String initializer;
    private final HashMap<String, String> variables;


}

Any idea !

Hello @AhmedAziz_Elj. You mention you are not using Spring Boot. Does this mean you are building your own configuration? If so, could you share it with us?

Parameter resolvers are used to resolve the arguments, if none is found for that argument, an error is thrown. This happens when inspecting the aggregate by the AnnotatedHandlerInspector. Somehow, the parameter resolves do not reach this inspector and you get this error.
When creating a Repository manually, you have to pass the parameterResolverFactory in. Easiest is to pass in ClasspathParameterResolverFactory.forClass(this.class).

I hope this helps

Hi @Morlack I think that I’m messing some configurations …
this my current config :

Configurer conf = DefaultConfigurer.defaultConfiguration()
                .configureAggregate(CamundaActionAggregate.class)
                .eventProcessing((eventProcessingConfigurer) -> eventProcessingConfigurer
                        .registerEventHandler(configuration -> new AggregateEventHandler()));
        Configuration configuration = conf.start();

Hello @Morlack I implemeted your solution but I still have the same error
this is my new configuration :

Configurer conf = DefaultConfigurer.defaultConfiguration()
                .configureAggregate(AggregateConfigurer.defaultConfiguration(CamundaActionAggregate.class)
                        .configureRepository(c -> EventSourcingRepository.builder(CamundaActionAggregate.class)
                                .eventStore(c.eventStore())
                                .parameterResolverFactory(ClasspathParameterResolverFactory.forClass(CamundaActionAggregate.class))
                                .build()))
                .eventProcessing((eventProcessingConfigurer) -> eventProcessingConfigurer
                        .registerEventHandler(configuration -> new AggregateEventHandler()));
        Configuration configuration = conf.start();