The UIMA-AS JmsAnalysisEngineServiceStub contains a static Map which holds a reference to a shared UIMA-AS client instance. This shared client is used by all AE instances in the JVM.
This implementation causes the extended tests to fail. There are a number junit tests that test different scenarios where JmsAnalysisEngineServiceStub is used. The first such test succeeds but subsequent ones fail with Exception "Uima EE Client Not in Running State".
This is caused by the fact that the static Map in JmsAnalysisEngineServiceStub is not being cleared when each test is done. It contains a stale reference from the previous junit test. This stale reference has been stopped and its "running" flag=false causing the above mentioned exception.
There is also another problem related to the lifecycle mgmt of the shared uima-as client instance. In the current code, the shared instance is stopped when destroy() method is called. This method is called N times, where N= number of AE instances. So on the first destroy() call, the uima-as client is stopped leaving the client in !running state. Subsequent invocations to sendAndReceive will fail again with above mentioned exception.