Cannot create aggregate repository if there is a second argument in command handler constructor

thake a look at this simple pice of code

data class Cmd(val id:UUID)

class MyComponent

class MyAggr(){
    final var id: UUID = UUID.randomUUID()

    myComponent: MyComponent


class MyConfig {

    fun createRepository(eventStore: EventStore?): Repository<MyAggr>? {
        val ret = EventSourcingRepository.builder(
        return ret

during the start up of application i get this error

Caused by: org.axonframework.messaging.annotation.UnsupportedHandlerException: Unable to resolve parameter 1 (MyComponent) in handler public rsobies.psd.common.MyAggr(rsobies.psd.common.Cmd,rsobies.psd.common.MyComponent).

the app runs without an error when i remove second argument from command handler constructor OR when I remove @Bean annotation from “createRepository” method so the bean will not be created
hmm, what am i doing wrong? how to correctly create aggregate repository to be able to inject it into another class?