Uploaded image for project: 'UIMA'
  1. UIMA
  2. UIMA-5189

UIMA-AS: error handling not working when XMI deserialization fails

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.9.0AS
    • Component/s: Async Scaleout
    • Labels:
      None

      Description

      The UIMA-AS service is not handling CAS deserialization errors correctly. When an incoming XMI contains bad data, the UIMA serializer throws

      org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 585;
      Character reference "&#

      The full stack trace below shows that the request flows through an error handler but the UIMA-AS cache look ups fail resulting in NPE.

      09:54:38.24 - 1:
      org.apache.uima.adapter.jms.activemq.SpringContainerDeployer.doStartListeners:
      INFO: Controller: XTokenizerAggregate Trying to Start Listener on
      Endpoint: queue://XTokenizerAggregate Selector: Command=2000 OR
      Command=2002 Broker: tcp://localhost:61616
      09:54:38.193 - 1:
      org.apache.uima.adapter.jms.activemq.SpringContainerDeployer.doStartListeners:
      INFO: Controller: XTokenizerAggregate Trying to Start Listener on
      Endpoint: queue://XTokenizerAggregate Selector: Command=2001 Broker:
      tcp://localhost:61616
      09:55:11.411 - 16:
      org.apache.uima.aae.handler.input.ProcessRequestHandler_impl.handleProcessRequestFromRemoteClient:
      WARNING: Service: XTokenizerAggregate Runtime Exception
      09:55:11.411 - 16:
      org.apache.uima.aae.handler.input.ProcessRequestHandler_impl.handleProcessRequestFromRemoteClient:
      WARNING:
      org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 585;
      Character reference "&#
      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1239)
      at org.apache.uima.aae.UimaSerializer.deserializeCasFromXmi(UimaSerializer.java:187)
      at org.apache.uima.aae.handler.input.ProcessRequestHandler_impl.deserializeCASandRegisterWithCache(ProcessRequestHandler_impl.java:220)
      at org.apache.uima.aae.handler.input.ProcessRequestHandler_impl.handleProcessRequestFromRemoteClient(ProcessRequestHandler_impl.java:531)
      at org.apache.uima.aae.handler.input.ProcessRequestHandler_impl.handle(ProcessRequestHandler_impl.java:1062)
      at org.apache.uima.aae.handler.input.MetadataRequestHandler_impl.handle(MetadataRequestHandler_impl.java:78)
      at org.apache.uima.adapter.jms.activemq.JmsInputChannel.onMessage(JmsInputChannel.java:731)
      at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:689)
      at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:649)
      at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:619)
      at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:307)
      at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:245)
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1144)
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1136)
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1033)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at org.apache.uima.aae.UimaAsThreadFactory$1.run(UimaAsThreadFactory.java:132)
      at java.lang.Thread.run(Thread.java:745)

      09:55:11.412 - 16:
      org.apache.uima.aae.error.handler.ProcessCasErrorHandler.handleError:
      WARNING: Service: XTokenizerAggregate Runtime Exception
      09:55:11.412 - 16:
      org.apache.uima.aae.error.handler.ProcessCasErrorHandler.handleError:
      WARNING:
      org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 585;
      Character reference "&#
      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1239)
      at org.apache.uima.aae.UimaSerializer.deserializeCasFromXmi(UimaSerializer.java:187)
      at org.apache.uima.aae.handler.input.ProcessRequestHandler_impl.deserializeCASandRegisterWithCache(ProcessRequestHandler_impl.java:220)
      at org.apache.uima.aae.handler.input.ProcessRequestHandler_impl.handleProcessRequestFromRemoteClient(ProcessRequestHandler_impl.java:531)
      at org.apache.uima.aae.handler.input.ProcessRequestHandler_impl.handle(ProcessRequestHandler_impl.java:1062)
      at org.apache.uima.aae.handler.input.MetadataRequestHandler_impl.handle(MetadataRequestHandler_impl.java:78)
      at org.apache.uima.adapter.jms.activemq.JmsInputChannel.onMessage(JmsInputChannel.java:731)
      at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:689)
      at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:649)
      at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:619)
      at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:307)
      at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:245)
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1144)
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1136)
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1033)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at org.apache.uima.aae.UimaAsThreadFactory$1.run(UimaAsThreadFactory.java:132)
      at java.lang.Thread.run(Thread.java:745)

      09:55:11.413 - 16:
      org.apache.uima.aae.error.handler.ProcessCasErrorHandler.handleError:
      INFO: Controller: XTokenizerAggregate Handling Exception. Delegate:
      ID:deploy-trusty-2-51366-1479431901326-1:1:15 Cas Id:
      ff737f8:15875035005:-4fe2
      09:55:11.413 - 16:
      org.apache.uima.aae.error.handler.ProcessCasErrorHandler.handleError:
      INFO: Controller: XTokenizerAggregate Parent CAS For CAS:
      ff737f8:15875035005:-4fe2 Not Found In Cache
      09:55:11.413 - 16:
      org.apache.uima.aae.controller.AggregateAnalysisEngineController_impl.process:
      WARNING: Service: XTokenizerAggregate Runtime Exception
      09:55:11.413 - 16:
      org.apache.uima.aae.controller.AggregateAnalysisEngineController_impl.process:
      WARNING:
      org.apache.uima.aae.error.AsynchAEException: Cas Not Found In
      CasManager Cache. CasReferenceId::ff737f8:15875035005:-4fe2 is Invalid
      at org.apache.uima.aae.InProcessCache.getCacheEntryForCAS(InProcessCache.java:522)
      at org.apache.uima.aae.controller.AggregateAnalysisEngineController_impl.process(AggregateAnalysisEngineController_impl.java:1117)
      at org.apache.uima.aae.error.handler.ProcessCasErrorHandler.handleError(ProcessCasErrorHandler.java:573)
      at org.apache.uima.aae.error.ErrorHandlerChain.handle(ErrorHandlerChain.java:57)
      at org.apache.uima.aae.handler.input.ProcessRequestHandler_impl.handleProcessRequestFromRemoteClient(ProcessRequestHandler_impl.java:601)
      at org.apache.uima.aae.handler.input.ProcessRequestHandler_impl.handle(ProcessRequestHandler_impl.java:1062)
      at org.apache.uima.aae.handler.input.MetadataRequestHandler_impl.handle(MetadataRequestHandler_impl.java:78)
      at org.apache.uima.adapter.jms.activemq.JmsInputChannel.onMessage(JmsInputChannel.java:731)
      at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:689)
      at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:649)
      at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:619)
      at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:307)
      at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:245)
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1144)
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1136)
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1033)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at org.apache.uima.aae.UimaAsThreadFactory$1.run(UimaAsThreadFactory.java:132)
      at java.lang.Thread.run(Thread.java:745)

      09:55:11.414 - 16:
      org.apache.uima.aae.controller.AggregateAnalysisEngineController_impl.process:
      WARNING: Service: XTokenizerAggregate Runtime Exception
      09:55:11.414 - 16:
      org.apache.uima.aae.controller.AggregateAnalysisEngineController_impl.process:
      WARNING:
      java.lang.NullPointerException
      at org.apache.uima.impl.Util.getStartingView(Util.java:45)
      at org.apache.uima.analysis_engine.asb.impl.FlowControllerContainer.computeFlow(FlowControllerContainer.java:219)
      at org.apache.uima.aae.controller.AggregateAnalysisEngineController_impl.process(AggregateAnalysisEngineController_impl.java:1224)
      at org.apache.uima.aae.error.handler.ProcessCasErrorHandler.handleError(ProcessCasErrorHandler.java:573)
      at org.apache.uima.aae.error.ErrorHandlerChain.handle(ErrorHandlerChain.java:57)
      at org.apache.uima.aae.handler.input.ProcessRequestHandler_impl.handleProcessRequestFromRemoteClient(ProcessRequestHandler_impl.java:601)
      at org.apache.uima.aae.handler.input.ProcessRequestHandler_impl.handle(ProcessRequestHandler_impl.java:1062)
      at org.apache.uima.aae.handler.input.MetadataRequestHandler_impl.handle(MetadataRequestHandler_impl.java:78)
      at org.apache.uima.adapter.jms.activemq.JmsInputChannel.onMessage(JmsInputChannel.java:731)
      at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:689)
      at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:649)
      at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:619)
      at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:307)
      at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:245)
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1144)
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1136)
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1033)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at org.apache.uima.aae.UimaAsThreadFactory$1.run(UimaAsThreadFactory.java:132)
      at java.lang.Thread.run(Thread.java:745)

      09:55:11.414 - 16:
      org.apache.uima.aae.controller.AggregateAnalysisEngineController_impl.sendReply:
      WARNING: Service: XTokenizerAggregate Runtime Exception
      09:55:11.414 - 16:
      org.apache.uima.aae.controller.AggregateAnalysisEngineController_impl.sendReply:
      WARNING:
      org.apache.uima.aae.error.AsynchAEException: Cas Not Found In
      CasManager Cache. CasReferenceId::ff737f8:15875035005:-4fe2 is Invalid
      at org.apache.uima.aae.InProcessCache.getCacheEntryForCAS(InProcessCache.java:522)
      at org.apache.uima.aae.controller.AggregateAnalysisEngineController_impl.sendReplyWithShutdownException(AggregateAnalysisEngineController_impl.java:996)
      at org.apache.uima.aae.controller.AggregateAnalysisEngineController_impl.process(AggregateAnalysisEngineController_impl.java:1250)
      at org.apache.uima.aae.error.handler.ProcessCasErrorHandler.handleError(ProcessCasErrorHandler.java:573)
      at org.apache.uima.aae.error.ErrorHandlerChain.handle(ErrorHandlerChain.java:57)
      at org.apache.uima.aae.handler.input.ProcessRequestHandler_impl.handleProcessRequestFromRemoteClient(ProcessRequestHandler_impl.java:601)
      at org.apache.uima.aae.handler.input.ProcessRequestHandler_impl.handle(ProcessRequestHandler_impl.java:1062)
      at org.apache.uima.aae.handler.input.MetadataRequestHandler_impl.handle(MetadataRequestHandler_impl.java:78)
      at org.apache.uima.adapter.jms.activemq.JmsInputChannel.onMessage(JmsInputChannel.java:731)
      at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:689)
      at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:649)
      at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:619)
      at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:307)
      at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:245)
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1144)
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1136)
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1033)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at org.apache.uima.aae.UimaAsThreadFactory$1.run(UimaAsThreadFactory.java:132)
      at java.lang.Thread.run(Thread.java:745)

        Attachments

          Activity

            People

            • Assignee:
              cwiklik Jerry Cwiklik
              Reporter:
              cwiklik Jerry Cwiklik
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: