HttpClientErrorException when executing a command


we get randomly the following exception when we execute a command.

org.axonframework.commandhandling.CommandExecutionException: org.springframework.web.client.HttpClientErrorException: 419 419
at org.axonframework.axonserver.connector.ErrorCode.lambda$static$10(
at org.axonframework.axonserver.connector.ErrorCode.convert(
at org.axonframework.axonserver.connector.command.CommandSerializer.deserialize(
at org.axonframework.axonserver.connector.command.AxonServerCommandBus$1.onNext(
at org.axonframework.axonserver.connector.command.AxonServerCommandBus$1.onNext(
at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onMessage(
at io.grpc.ForwardingClientCallListener.onMessage(
at io.grpc.ForwardingClientCallListener.onMessage(
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessagesAvailable.runInternal(
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessagesAvailable.runInContext(
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.base/java.util.concurrent.ThreadPoolExecutor$
at java.base/
Caused by: org.axonframework.axonserver.connector.command.AxonServerRemoteCommandHandlingException: An exception was thrown by the remote message handling component: org.springframework.web.client.HttpClientErrorException: 419 419
Caused by 419 419

And idea what is causing this? It also happens in an integration test somtimes. So it is somehow reproducable…
The command is executed in our rest endpoint which is processed by an Aggregate in the same service.

Best, Michael

Hi I was debugging a little bit more.

it seems when I get the error I do not get to the Aggregate at all.

I’ using the

Are there maybe known issues related to that? I use the 4.3.2 framework version.

Best, Michael

I tested also framework 4.3.3 - no difference.

This is the command failing:

Result result = commandGateway.sendAndWait(
    new MyCommand(id), 5000L, TimeUnit.MILLISECONDS);

The stack has change a little bit. It seems simply to timeout once in a while.

org.axonframework.commandhandling.CommandExecutionException: An exception occurred while executing a command
at org.axonframework.commandhandling.gateway.DefaultCommandGateway.asRuntime(
at org.axonframework.commandhandling.gateway.DefaultCommandGateway.sendAndWait(

Best, Michael

If I restart the axon server incl. db the it rest runs fine 100% for exactly 1 time!

After that I get
org.axonframework.commandhandling.CommandExecutionException: org.springframework.web.client.HttpClientErrorException: 419 419

Any ideas?

Hi Michael,

are you using a Spring HTTP client somewhere? It seems that it is doing a request and getting a HTTP 419 back.
As far as I know, Axon itself doesn’t use any HTTP clients, except in the Axon - SpringCloud extension, which I suspect you are not using at this time.

Hi Allard,

The problem was a service which was crashed and still in the background. It was receiving this command and reporting this error. After killing it everything worked like expected.

Best Regards,