Exception while closing command context (How skip task ending)

I tried to repeat the problem with a simple example, but was not successful.
I keep trying to recreate the problem with a simple example.
I will let to know when I get more specifics.
Thank you!

  1. WildFly 11
  2. java-1.8.0-openjdk
  3. MariaDB-10.2.8