Axon Server Command does not contain routing key










1















I am trying to migrate my application to Axon 4.0 with Axon server.
Here is my code.



data class CreateTravelProductCommand(
@TargetAggregateIdentifier val id: String,
val productCreator: String
)

val id: String = ObjectId.get().toString()
val command = CreateTravelProductCommand(id=id, productCreator=request.creator)
commandGateway.sendAndWait(command)


But I got this error with my command.




org.axonframework.commandhandling.distributed.CommandDispatchException:
The command [com.sunday.api.product.CreateTravelProductCommand] does
not contain a routing key.
at org.axonframework.commandhandling.distributed.AbstractRoutingStrategy.getRoutingKey(AbstractRoutingStrategy.java:57)
~[axon-messaging-4.0.jar:4.0]
at org.axonframework.axonserver.connector.command.AxonServerCommandBus.dispatch(AxonServerCommandBus.java:114)
~[axon-server-connector-4.0.jar:4.0]
at org.axonframework.commandhandling.gateway.AbstractCommandGateway.send(AbstractCommandGateway.java:75)
[axon-messaging-4.0.jar:4.0]
at org.axonframework.commandhandling.gateway.DefaultCommandGateway.send(DefaultCommandGateway.java:78)
[axon-messaging-4.0.jar:4.0]
at org.axonframework.commandhandling.gateway.DefaultCommandGateway.sendAndWait(DefaultCommandGateway.java:96)
[axon-messaging-4.0.jar:4.0]
at com.sunday.underwriting.product.ProductHandler.sendCreateProductCommand(ProductHandler.kt:40)
[classes/:na]
at com.sunday.underwriting.product.ProductHandler.access$sendCreateProductCommand(ProductHandler.kt:33)
[classes/:na]
at com.sunday.underwriting.product.ProductHandler$createProduct$product$1.invoke(ProductHandler.kt:97)
[classes/:na]
at com.sunday.underwriting.product.ProductHandler$createProduct$product$1.invoke(ProductHandler.kt:33)
[classes/:na]
at com.sunday.underwriting.product.ProductHandler$sam$java_util_function_Function$0.apply(ProductHandler.kt)
[classes/:na]
at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:100)
[reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:73)
[reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1476)
[reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
at reactor.core.publisher.MonoSingle$SingleSubscriber.onComplete(MonoSingle.java:171)
[reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:136)
[reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
at reactor.core.publisher.FluxFlatMap$FlatMapMain.checkTerminated(FluxFlatMap.java:794)
[reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
at reactor.core.publisher.FluxFlatMap$FlatMapMain.drainLoop(FluxFlatMap.java:560)
[reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
at reactor.core.publisher.FluxFlatMap$FlatMapMain.drain(FluxFlatMap.java:540)
[reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
at reactor.core.publisher.FluxFlatMap$FlatMapMain.onComplete(FluxFlatMap.java:426)
[reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
at reactor.core.publisher.DrainUtils.postCompleteDrain(DrainUtils.java:131)
[reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
at reactor.core.publisher.DrainUtils.postComplete(DrainUtils.java:186)
[reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
at reactor.core.publisher.FluxMapSignal$FluxMapSignalSubscriber.onComplete(FluxMapSignal.java:213)
[reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:136)
[reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:252)
[reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:136)
[reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
at reactor.netty.channel.FluxReceive.terminateReceiver(FluxReceive.java:378)
[reactor-netty-0.8.2.RELEASE.jar:0.8.2.RELEASE]
at reactor.netty.channel.FluxReceive.drainReceiver(FluxReceive.java:202)
[reactor-netty-0.8.2.RELEASE.jar:0.8.2.RELEASE]
at reactor.netty.channel.FluxReceive.onInboundComplete(FluxReceive.java:343)
[reactor-netty-0.8.2.RELEASE.jar:0.8.2.RELEASE]
at reactor.netty.channel.ChannelOperations.onInboundComplete(ChannelOperations.java:325)
[reactor-netty-0.8.2.RELEASE.jar:0.8.2.RELEASE]
at reactor.netty.http.server.HttpServerOperations.onInboundNext(HttpServerOperations.java:442)
[reactor-netty-0.8.2.RELEASE.jar:0.8.2.RELEASE]
at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:141)
[reactor-netty-0.8.2.RELEASE.jar:0.8.2.RELEASE]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
[netty-transport-4.1.29.Final.jar:4.1.29.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
[netty-transport-4.1.29.Final.jar:4.1.29.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
[netty-transport-4.1.29.Final.jar:4.1.29.Final]
at reactor.netty.http.server.HttpTrafficHandler.channelRead(HttpTrafficHandler.java:188)
[reactor-netty-0.8.2.RELEASE.jar:0.8.2.RELEASE]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
[netty-transport-4.1.29.Final.jar:4.1.29.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
[netty-transport-4.1.29.Final.jar:4.1.29.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
[netty-transport-4.1.29.Final.jar:4.1.29.Final]
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438)
[netty-transport-4.1.29.Final.jar:4.1.29.Final]
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310)
[netty-codec-4.1.29.Final.jar:4.1.29.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284)
[netty-codec-4.1.29.Final.jar:4.1.29.Final]
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253)
[netty-transport-4.1.29.Final.jar:4.1.29.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
[netty-transport-4.1.29.Final.jar:4.1.29.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
[netty-transport-4.1.29.Final.jar:4.1.29.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
[netty-transport-4.1.29.Final.jar:4.1.29.Final]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434)
[netty-transport-4.1.29.Final.jar:4.1.29.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
[netty-transport-4.1.29.Final.jar:4.1.29.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
[netty-transport-4.1.29.Final.jar:4.1.29.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965)
[netty-transport-4.1.29.Final.jar:4.1.29.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
[netty-transport-4.1.29.Final.jar:4.1.29.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:628)
[netty-transport-4.1.29.Final.jar:4.1.29.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:563)
[netty-transport-4.1.29.Final.jar:4.1.29.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:480)
[netty-transport-4.1.29.Final.jar:4.1.29.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:442) [netty-transport-4.1.29.Final.jar:4.1.29.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)
[netty-common-4.1.29.Final.jar:4.1.29.Final]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_172]




Edit:



I just found out that if you keep the class in the same project, it is ok.



The problem is when you import the class from another project (Which used to work prior to axon server)



For example:



My project has dependencies of another project called api.



dependencies 
compile project(':api')



If the class is declared in the api project, axon server library will throw error that it cannot find routing key. But if the class is declared in the main project it self, it works as expected. I think I should file this issue on github.










share|improve this question




























    1















    I am trying to migrate my application to Axon 4.0 with Axon server.
    Here is my code.



    data class CreateTravelProductCommand(
    @TargetAggregateIdentifier val id: String,
    val productCreator: String
    )

    val id: String = ObjectId.get().toString()
    val command = CreateTravelProductCommand(id=id, productCreator=request.creator)
    commandGateway.sendAndWait(command)


    But I got this error with my command.




    org.axonframework.commandhandling.distributed.CommandDispatchException:
    The command [com.sunday.api.product.CreateTravelProductCommand] does
    not contain a routing key.
    at org.axonframework.commandhandling.distributed.AbstractRoutingStrategy.getRoutingKey(AbstractRoutingStrategy.java:57)
    ~[axon-messaging-4.0.jar:4.0]
    at org.axonframework.axonserver.connector.command.AxonServerCommandBus.dispatch(AxonServerCommandBus.java:114)
    ~[axon-server-connector-4.0.jar:4.0]
    at org.axonframework.commandhandling.gateway.AbstractCommandGateway.send(AbstractCommandGateway.java:75)
    [axon-messaging-4.0.jar:4.0]
    at org.axonframework.commandhandling.gateway.DefaultCommandGateway.send(DefaultCommandGateway.java:78)
    [axon-messaging-4.0.jar:4.0]
    at org.axonframework.commandhandling.gateway.DefaultCommandGateway.sendAndWait(DefaultCommandGateway.java:96)
    [axon-messaging-4.0.jar:4.0]
    at com.sunday.underwriting.product.ProductHandler.sendCreateProductCommand(ProductHandler.kt:40)
    [classes/:na]
    at com.sunday.underwriting.product.ProductHandler.access$sendCreateProductCommand(ProductHandler.kt:33)
    [classes/:na]
    at com.sunday.underwriting.product.ProductHandler$createProduct$product$1.invoke(ProductHandler.kt:97)
    [classes/:na]
    at com.sunday.underwriting.product.ProductHandler$createProduct$product$1.invoke(ProductHandler.kt:33)
    [classes/:na]
    at com.sunday.underwriting.product.ProductHandler$sam$java_util_function_Function$0.apply(ProductHandler.kt)
    [classes/:na]
    at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:100)
    [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:73)
    [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1476)
    [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at reactor.core.publisher.MonoSingle$SingleSubscriber.onComplete(MonoSingle.java:171)
    [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:136)
    [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at reactor.core.publisher.FluxFlatMap$FlatMapMain.checkTerminated(FluxFlatMap.java:794)
    [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at reactor.core.publisher.FluxFlatMap$FlatMapMain.drainLoop(FluxFlatMap.java:560)
    [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at reactor.core.publisher.FluxFlatMap$FlatMapMain.drain(FluxFlatMap.java:540)
    [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at reactor.core.publisher.FluxFlatMap$FlatMapMain.onComplete(FluxFlatMap.java:426)
    [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at reactor.core.publisher.DrainUtils.postCompleteDrain(DrainUtils.java:131)
    [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at reactor.core.publisher.DrainUtils.postComplete(DrainUtils.java:186)
    [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at reactor.core.publisher.FluxMapSignal$FluxMapSignalSubscriber.onComplete(FluxMapSignal.java:213)
    [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:136)
    [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:252)
    [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:136)
    [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at reactor.netty.channel.FluxReceive.terminateReceiver(FluxReceive.java:378)
    [reactor-netty-0.8.2.RELEASE.jar:0.8.2.RELEASE]
    at reactor.netty.channel.FluxReceive.drainReceiver(FluxReceive.java:202)
    [reactor-netty-0.8.2.RELEASE.jar:0.8.2.RELEASE]
    at reactor.netty.channel.FluxReceive.onInboundComplete(FluxReceive.java:343)
    [reactor-netty-0.8.2.RELEASE.jar:0.8.2.RELEASE]
    at reactor.netty.channel.ChannelOperations.onInboundComplete(ChannelOperations.java:325)
    [reactor-netty-0.8.2.RELEASE.jar:0.8.2.RELEASE]
    at reactor.netty.http.server.HttpServerOperations.onInboundNext(HttpServerOperations.java:442)
    [reactor-netty-0.8.2.RELEASE.jar:0.8.2.RELEASE]
    at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:141)
    [reactor-netty-0.8.2.RELEASE.jar:0.8.2.RELEASE]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    [netty-transport-4.1.29.Final.jar:4.1.29.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    [netty-transport-4.1.29.Final.jar:4.1.29.Final]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
    [netty-transport-4.1.29.Final.jar:4.1.29.Final]
    at reactor.netty.http.server.HttpTrafficHandler.channelRead(HttpTrafficHandler.java:188)
    [reactor-netty-0.8.2.RELEASE.jar:0.8.2.RELEASE]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    [netty-transport-4.1.29.Final.jar:4.1.29.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    [netty-transport-4.1.29.Final.jar:4.1.29.Final]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
    [netty-transport-4.1.29.Final.jar:4.1.29.Final]
    at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438)
    [netty-transport-4.1.29.Final.jar:4.1.29.Final]
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310)
    [netty-codec-4.1.29.Final.jar:4.1.29.Final]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284)
    [netty-codec-4.1.29.Final.jar:4.1.29.Final]
    at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253)
    [netty-transport-4.1.29.Final.jar:4.1.29.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    [netty-transport-4.1.29.Final.jar:4.1.29.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    [netty-transport-4.1.29.Final.jar:4.1.29.Final]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
    [netty-transport-4.1.29.Final.jar:4.1.29.Final]
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434)
    [netty-transport-4.1.29.Final.jar:4.1.29.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    [netty-transport-4.1.29.Final.jar:4.1.29.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    [netty-transport-4.1.29.Final.jar:4.1.29.Final]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965)
    [netty-transport-4.1.29.Final.jar:4.1.29.Final]
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
    [netty-transport-4.1.29.Final.jar:4.1.29.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:628)
    [netty-transport-4.1.29.Final.jar:4.1.29.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:563)
    [netty-transport-4.1.29.Final.jar:4.1.29.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:480)
    [netty-transport-4.1.29.Final.jar:4.1.29.Final]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:442) [netty-transport-4.1.29.Final.jar:4.1.29.Final]
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)
    [netty-common-4.1.29.Final.jar:4.1.29.Final]
    at java.lang.Thread.run(Thread.java:748) [na:1.8.0_172]




    Edit:



    I just found out that if you keep the class in the same project, it is ok.



    The problem is when you import the class from another project (Which used to work prior to axon server)



    For example:



    My project has dependencies of another project called api.



    dependencies 
    compile project(':api')



    If the class is declared in the api project, axon server library will throw error that it cannot find routing key. But if the class is declared in the main project it self, it works as expected. I think I should file this issue on github.










    share|improve this question


























      1












      1








      1








      I am trying to migrate my application to Axon 4.0 with Axon server.
      Here is my code.



      data class CreateTravelProductCommand(
      @TargetAggregateIdentifier val id: String,
      val productCreator: String
      )

      val id: String = ObjectId.get().toString()
      val command = CreateTravelProductCommand(id=id, productCreator=request.creator)
      commandGateway.sendAndWait(command)


      But I got this error with my command.




      org.axonframework.commandhandling.distributed.CommandDispatchException:
      The command [com.sunday.api.product.CreateTravelProductCommand] does
      not contain a routing key.
      at org.axonframework.commandhandling.distributed.AbstractRoutingStrategy.getRoutingKey(AbstractRoutingStrategy.java:57)
      ~[axon-messaging-4.0.jar:4.0]
      at org.axonframework.axonserver.connector.command.AxonServerCommandBus.dispatch(AxonServerCommandBus.java:114)
      ~[axon-server-connector-4.0.jar:4.0]
      at org.axonframework.commandhandling.gateway.AbstractCommandGateway.send(AbstractCommandGateway.java:75)
      [axon-messaging-4.0.jar:4.0]
      at org.axonframework.commandhandling.gateway.DefaultCommandGateway.send(DefaultCommandGateway.java:78)
      [axon-messaging-4.0.jar:4.0]
      at org.axonframework.commandhandling.gateway.DefaultCommandGateway.sendAndWait(DefaultCommandGateway.java:96)
      [axon-messaging-4.0.jar:4.0]
      at com.sunday.underwriting.product.ProductHandler.sendCreateProductCommand(ProductHandler.kt:40)
      [classes/:na]
      at com.sunday.underwriting.product.ProductHandler.access$sendCreateProductCommand(ProductHandler.kt:33)
      [classes/:na]
      at com.sunday.underwriting.product.ProductHandler$createProduct$product$1.invoke(ProductHandler.kt:97)
      [classes/:na]
      at com.sunday.underwriting.product.ProductHandler$createProduct$product$1.invoke(ProductHandler.kt:33)
      [classes/:na]
      at com.sunday.underwriting.product.ProductHandler$sam$java_util_function_Function$0.apply(ProductHandler.kt)
      [classes/:na]
      at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:100)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:73)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1476)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.core.publisher.MonoSingle$SingleSubscriber.onComplete(MonoSingle.java:171)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:136)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.core.publisher.FluxFlatMap$FlatMapMain.checkTerminated(FluxFlatMap.java:794)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.core.publisher.FluxFlatMap$FlatMapMain.drainLoop(FluxFlatMap.java:560)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.core.publisher.FluxFlatMap$FlatMapMain.drain(FluxFlatMap.java:540)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.core.publisher.FluxFlatMap$FlatMapMain.onComplete(FluxFlatMap.java:426)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.core.publisher.DrainUtils.postCompleteDrain(DrainUtils.java:131)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.core.publisher.DrainUtils.postComplete(DrainUtils.java:186)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.core.publisher.FluxMapSignal$FluxMapSignalSubscriber.onComplete(FluxMapSignal.java:213)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:136)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:252)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:136)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.netty.channel.FluxReceive.terminateReceiver(FluxReceive.java:378)
      [reactor-netty-0.8.2.RELEASE.jar:0.8.2.RELEASE]
      at reactor.netty.channel.FluxReceive.drainReceiver(FluxReceive.java:202)
      [reactor-netty-0.8.2.RELEASE.jar:0.8.2.RELEASE]
      at reactor.netty.channel.FluxReceive.onInboundComplete(FluxReceive.java:343)
      [reactor-netty-0.8.2.RELEASE.jar:0.8.2.RELEASE]
      at reactor.netty.channel.ChannelOperations.onInboundComplete(ChannelOperations.java:325)
      [reactor-netty-0.8.2.RELEASE.jar:0.8.2.RELEASE]
      at reactor.netty.http.server.HttpServerOperations.onInboundNext(HttpServerOperations.java:442)
      [reactor-netty-0.8.2.RELEASE.jar:0.8.2.RELEASE]
      at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:141)
      [reactor-netty-0.8.2.RELEASE.jar:0.8.2.RELEASE]
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at reactor.netty.http.server.HttpTrafficHandler.channelRead(HttpTrafficHandler.java:188)
      [reactor-netty-0.8.2.RELEASE.jar:0.8.2.RELEASE]
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310)
      [netty-codec-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284)
      [netty-codec-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:628)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:563)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:480)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:442) [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)
      [netty-common-4.1.29.Final.jar:4.1.29.Final]
      at java.lang.Thread.run(Thread.java:748) [na:1.8.0_172]




      Edit:



      I just found out that if you keep the class in the same project, it is ok.



      The problem is when you import the class from another project (Which used to work prior to axon server)



      For example:



      My project has dependencies of another project called api.



      dependencies 
      compile project(':api')



      If the class is declared in the api project, axon server library will throw error that it cannot find routing key. But if the class is declared in the main project it self, it works as expected. I think I should file this issue on github.










      share|improve this question
















      I am trying to migrate my application to Axon 4.0 with Axon server.
      Here is my code.



      data class CreateTravelProductCommand(
      @TargetAggregateIdentifier val id: String,
      val productCreator: String
      )

      val id: String = ObjectId.get().toString()
      val command = CreateTravelProductCommand(id=id, productCreator=request.creator)
      commandGateway.sendAndWait(command)


      But I got this error with my command.




      org.axonframework.commandhandling.distributed.CommandDispatchException:
      The command [com.sunday.api.product.CreateTravelProductCommand] does
      not contain a routing key.
      at org.axonframework.commandhandling.distributed.AbstractRoutingStrategy.getRoutingKey(AbstractRoutingStrategy.java:57)
      ~[axon-messaging-4.0.jar:4.0]
      at org.axonframework.axonserver.connector.command.AxonServerCommandBus.dispatch(AxonServerCommandBus.java:114)
      ~[axon-server-connector-4.0.jar:4.0]
      at org.axonframework.commandhandling.gateway.AbstractCommandGateway.send(AbstractCommandGateway.java:75)
      [axon-messaging-4.0.jar:4.0]
      at org.axonframework.commandhandling.gateway.DefaultCommandGateway.send(DefaultCommandGateway.java:78)
      [axon-messaging-4.0.jar:4.0]
      at org.axonframework.commandhandling.gateway.DefaultCommandGateway.sendAndWait(DefaultCommandGateway.java:96)
      [axon-messaging-4.0.jar:4.0]
      at com.sunday.underwriting.product.ProductHandler.sendCreateProductCommand(ProductHandler.kt:40)
      [classes/:na]
      at com.sunday.underwriting.product.ProductHandler.access$sendCreateProductCommand(ProductHandler.kt:33)
      [classes/:na]
      at com.sunday.underwriting.product.ProductHandler$createProduct$product$1.invoke(ProductHandler.kt:97)
      [classes/:na]
      at com.sunday.underwriting.product.ProductHandler$createProduct$product$1.invoke(ProductHandler.kt:33)
      [classes/:na]
      at com.sunday.underwriting.product.ProductHandler$sam$java_util_function_Function$0.apply(ProductHandler.kt)
      [classes/:na]
      at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:100)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:73)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1476)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.core.publisher.MonoSingle$SingleSubscriber.onComplete(MonoSingle.java:171)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:136)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.core.publisher.FluxFlatMap$FlatMapMain.checkTerminated(FluxFlatMap.java:794)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.core.publisher.FluxFlatMap$FlatMapMain.drainLoop(FluxFlatMap.java:560)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.core.publisher.FluxFlatMap$FlatMapMain.drain(FluxFlatMap.java:540)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.core.publisher.FluxFlatMap$FlatMapMain.onComplete(FluxFlatMap.java:426)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.core.publisher.DrainUtils.postCompleteDrain(DrainUtils.java:131)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.core.publisher.DrainUtils.postComplete(DrainUtils.java:186)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.core.publisher.FluxMapSignal$FluxMapSignalSubscriber.onComplete(FluxMapSignal.java:213)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:136)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:252)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:136)
      [reactor-core-3.2.2.RELEASE.jar:3.2.2.RELEASE]
      at reactor.netty.channel.FluxReceive.terminateReceiver(FluxReceive.java:378)
      [reactor-netty-0.8.2.RELEASE.jar:0.8.2.RELEASE]
      at reactor.netty.channel.FluxReceive.drainReceiver(FluxReceive.java:202)
      [reactor-netty-0.8.2.RELEASE.jar:0.8.2.RELEASE]
      at reactor.netty.channel.FluxReceive.onInboundComplete(FluxReceive.java:343)
      [reactor-netty-0.8.2.RELEASE.jar:0.8.2.RELEASE]
      at reactor.netty.channel.ChannelOperations.onInboundComplete(ChannelOperations.java:325)
      [reactor-netty-0.8.2.RELEASE.jar:0.8.2.RELEASE]
      at reactor.netty.http.server.HttpServerOperations.onInboundNext(HttpServerOperations.java:442)
      [reactor-netty-0.8.2.RELEASE.jar:0.8.2.RELEASE]
      at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:141)
      [reactor-netty-0.8.2.RELEASE.jar:0.8.2.RELEASE]
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at reactor.netty.http.server.HttpTrafficHandler.channelRead(HttpTrafficHandler.java:188)
      [reactor-netty-0.8.2.RELEASE.jar:0.8.2.RELEASE]
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310)
      [netty-codec-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284)
      [netty-codec-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:628)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:563)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:480)
      [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:442) [netty-transport-4.1.29.Final.jar:4.1.29.Final]
      at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)
      [netty-common-4.1.29.Final.jar:4.1.29.Final]
      at java.lang.Thread.run(Thread.java:748) [na:1.8.0_172]




      Edit:



      I just found out that if you keep the class in the same project, it is ok.



      The problem is when you import the class from another project (Which used to work prior to axon server)



      For example:



      My project has dependencies of another project called api.



      dependencies 
      compile project(':api')



      If the class is declared in the api project, axon server library will throw error that it cannot find routing key. But if the class is declared in the main project it self, it works as expected. I think I should file this issue on github.







      java axon






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 15 '18 at 10:31







      Bads

















      asked Nov 15 '18 at 4:19









      BadsBads

      3933415




      3933415






















          3 Answers
          3






          active

          oldest

          votes


















          1














          The real issue is version mismatched between 2 projects. I had to correct version but intellij autoloader didn't work and the api project had the incorrect version.



          I apologize for my stupidity






          share|improve this answer






























            0














            This is actually more related to Kotlin than Axon. Axon expects them on the Field or Getter method. Apparently, that's not where Kotlin places them be default.



            Check out https://kotlinlang.org/docs/reference/annotations.html#annotation-use-site-targets



            You probably need to annotate the property with @get:TargetAggregateIdentifier






            share|improve this answer






























              0














              I got the same problem when migrating from Axon 3.x to 4.0.
              The solution was related to the @TargetAggregateIdentifier - I was missing it off the 'CreateXXXCommand' that's handled by my aggregate. I'm pretty sure that adding @TargetAggregateIdentifier wasn't necessary for create commands (since it doesn't have to locate an existing aggregate) in Axon 3.x



              At time of writing the Migration guide is incomplete https://docs.axoniq.io/reference-guide/3-migration/migration-guide






              share|improve this answer






















                Your Answer






                StackExchange.ifUsing("editor", function ()
                StackExchange.using("externalEditor", function ()
                StackExchange.using("snippets", function ()
                StackExchange.snippets.init();
                );
                );
                , "code-snippets");

                StackExchange.ready(function()
                var channelOptions =
                tags: "".split(" "),
                id: "1"
                ;
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function()
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled)
                StackExchange.using("snippets", function()
                createEditor();
                );

                else
                createEditor();

                );

                function createEditor()
                StackExchange.prepareEditor(
                heartbeatType: 'answer',
                autoActivateHeartbeat: false,
                convertImagesToLinks: true,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: 10,
                bindNavPrevention: true,
                postfix: "",
                imageUploader:
                brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                allowUrls: true
                ,
                onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                );



                );













                draft saved

                draft discarded


















                StackExchange.ready(
                function ()
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53312390%2faxon-server-command-does-not-contain-routing-key%23new-answer', 'question_page');

                );

                Post as a guest















                Required, but never shown

























                3 Answers
                3






                active

                oldest

                votes








                3 Answers
                3






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                1














                The real issue is version mismatched between 2 projects. I had to correct version but intellij autoloader didn't work and the api project had the incorrect version.



                I apologize for my stupidity






                share|improve this answer



























                  1














                  The real issue is version mismatched between 2 projects. I had to correct version but intellij autoloader didn't work and the api project had the incorrect version.



                  I apologize for my stupidity






                  share|improve this answer

























                    1












                    1








                    1







                    The real issue is version mismatched between 2 projects. I had to correct version but intellij autoloader didn't work and the api project had the incorrect version.



                    I apologize for my stupidity






                    share|improve this answer













                    The real issue is version mismatched between 2 projects. I had to correct version but intellij autoloader didn't work and the api project had the incorrect version.



                    I apologize for my stupidity







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Nov 16 '18 at 2:37









                    BadsBads

                    3933415




                    3933415























                        0














                        This is actually more related to Kotlin than Axon. Axon expects them on the Field or Getter method. Apparently, that's not where Kotlin places them be default.



                        Check out https://kotlinlang.org/docs/reference/annotations.html#annotation-use-site-targets



                        You probably need to annotate the property with @get:TargetAggregateIdentifier






                        share|improve this answer



























                          0














                          This is actually more related to Kotlin than Axon. Axon expects them on the Field or Getter method. Apparently, that's not where Kotlin places them be default.



                          Check out https://kotlinlang.org/docs/reference/annotations.html#annotation-use-site-targets



                          You probably need to annotate the property with @get:TargetAggregateIdentifier






                          share|improve this answer

























                            0












                            0








                            0







                            This is actually more related to Kotlin than Axon. Axon expects them on the Field or Getter method. Apparently, that's not where Kotlin places them be default.



                            Check out https://kotlinlang.org/docs/reference/annotations.html#annotation-use-site-targets



                            You probably need to annotate the property with @get:TargetAggregateIdentifier






                            share|improve this answer













                            This is actually more related to Kotlin than Axon. Axon expects them on the Field or Getter method. Apparently, that's not where Kotlin places them be default.



                            Check out https://kotlinlang.org/docs/reference/annotations.html#annotation-use-site-targets



                            You probably need to annotate the property with @get:TargetAggregateIdentifier







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Nov 15 '18 at 8:55









                            AllardAllard

                            1,14166




                            1,14166





















                                0














                                I got the same problem when migrating from Axon 3.x to 4.0.
                                The solution was related to the @TargetAggregateIdentifier - I was missing it off the 'CreateXXXCommand' that's handled by my aggregate. I'm pretty sure that adding @TargetAggregateIdentifier wasn't necessary for create commands (since it doesn't have to locate an existing aggregate) in Axon 3.x



                                At time of writing the Migration guide is incomplete https://docs.axoniq.io/reference-guide/3-migration/migration-guide






                                share|improve this answer



























                                  0














                                  I got the same problem when migrating from Axon 3.x to 4.0.
                                  The solution was related to the @TargetAggregateIdentifier - I was missing it off the 'CreateXXXCommand' that's handled by my aggregate. I'm pretty sure that adding @TargetAggregateIdentifier wasn't necessary for create commands (since it doesn't have to locate an existing aggregate) in Axon 3.x



                                  At time of writing the Migration guide is incomplete https://docs.axoniq.io/reference-guide/3-migration/migration-guide






                                  share|improve this answer

























                                    0












                                    0








                                    0







                                    I got the same problem when migrating from Axon 3.x to 4.0.
                                    The solution was related to the @TargetAggregateIdentifier - I was missing it off the 'CreateXXXCommand' that's handled by my aggregate. I'm pretty sure that adding @TargetAggregateIdentifier wasn't necessary for create commands (since it doesn't have to locate an existing aggregate) in Axon 3.x



                                    At time of writing the Migration guide is incomplete https://docs.axoniq.io/reference-guide/3-migration/migration-guide






                                    share|improve this answer













                                    I got the same problem when migrating from Axon 3.x to 4.0.
                                    The solution was related to the @TargetAggregateIdentifier - I was missing it off the 'CreateXXXCommand' that's handled by my aggregate. I'm pretty sure that adding @TargetAggregateIdentifier wasn't necessary for create commands (since it doesn't have to locate an existing aggregate) in Axon 3.x



                                    At time of writing the Migration guide is incomplete https://docs.axoniq.io/reference-guide/3-migration/migration-guide







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Dec 19 '18 at 3:16









                                    jorrocksjorrocks

                                    312




                                    312



























                                        draft saved

                                        draft discarded
















































                                        Thanks for contributing an answer to Stack Overflow!


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid


                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.

                                        To learn more, see our tips on writing great answers.




                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function ()
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53312390%2faxon-server-command-does-not-contain-routing-key%23new-answer', 'question_page');

                                        );

                                        Post as a guest















                                        Required, but never shown





















































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown

































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown







                                        這個網誌中的熱門文章

                                        How to read a connectionString WITH PROVIDER in .NET Core?

                                        Node.js Script on GitHub Pages or Amazon S3

                                        Museum of Modern and Contemporary Art of Trento and Rovereto