Package org.apache.uima.aae.error

Examples of org.apache.uima.aae.error.UimaEEServiceException


          Throwable wrapper = null;
          if (!(t instanceof UimaEEServiceException)) {
            // Strip off AsyncAEException and replace with UimaEEServiceException
            if (t instanceof AsynchAEException && t.getCause() != null) {
              wrapper = new UimaEEServiceException(t.getCause());
            } else {
              wrapper = new UimaEEServiceException(t);
            }
          }
          if (wrapper == null) {
            message.addObjectProperty(AsynchAEMessage.Cargo, t);
          } else {
View Full Code Here


    try {
      Throwable wrapper = null;
      if (!(t instanceof UimaEEServiceException)) {
        // Strip off AsyncAEException and replace with UimaEEServiceException
        if (t instanceof AsynchAEException && t.getCause() != null) {
          wrapper = new UimaEEServiceException(t.getCause());
        } else {
          wrapper = new UimaEEServiceException(t);
        }
      }
      if (aborting) {
        return;
      }
      anEndpoint.setReplyEndpoint(true);
      JmsEndpointConnection_impl endpointConnection = getEndpointConnection(anEndpoint);
      // Create Message that will contain serialized Exception with stack
      ObjectMessage om = endpointConnection.produceObjectMessage();
      //  Now try to catch non-serializable exception. The Throwable passed into this method may
      //  not be serializable. Catch the exception, and create a wrapper containing stringified 
      //  stack trace.
      try {
          //  serialize the Throwable
          if (wrapper == null) {
            om.setObject(t);
          } else {
            om.setObject(wrapper);
          }
      } catch( RuntimeException e) {
          //  Check if we failed due to non-serializable object in the Throwable
          if ( e.getCause() != null && e.getCause() instanceof NotSerializableException ) {
            //  stringify the stack trace
            StringWriter sw = new StringWriter();
            t.printStackTrace(new PrintWriter(sw));
            wrapper = new UimaEEServiceException(sw.toString());
            //  serialize the new wrapper
            om.setObject(wrapper);
          } else {
            throw e;  // rethrow
          }
View Full Code Here

                  JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                  "UIMAJMS_invalid_serializer__WARNING",
                  new Object[] { getAnalysisEngineController().getName(), serializer,
                      anEndpoint.getEndpoint() });
        }
        throw new UimaEEServiceException("Invalid Serializer:" + serializer + " For Endpoint:"
                + anEndpoint.getEndpoint());
      }
      long timeToSerializeCas = getAnalysisEngineController().getCpuTime() - t1;

      getAnalysisEngineController().incrementSerializationTime(timeToSerializeCas);
View Full Code Here

      Throwable wrapper = null;
      Throwable cause = casStateEntry.getErrors().get(0);
      if (!(cause instanceof UimaEEServiceException)) {
        // Strip off AsyncAEException and replace with UimaEEServiceException
        if (cause instanceof AsynchAEException && cause.getCause() != null) {
          wrapper = new UimaEEServiceException(cause.getCause());
        } else {
          wrapper = new UimaEEServiceException(cause);
        }
      }
      if (wrapper == null) {
        message.addObjectProperty(AsynchAEMessage.Cargo, cause);
      } else {
View Full Code Here

        }
        getInProcessCache().getEndpoint(anEndpoint, casReferenceId).cancelTimer();
        Endpoint requestOrigin = cachedEntries[i].getMessageOrigin();
        try {
          getOutputChannel().sendReply(
                  new UimaEEServiceException("Delegates Not Found To Process CAS on Endpoint:"
                          + anEndpoint), casReferenceId, parentCasReferenceId, requestOrigin,
                  AsynchAEMessage.Process);
        } catch (Exception e) {
          if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
            UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, CLASS_NAME.getName(),
View Full Code Here

    Exception exception = null;
    if (message instanceof ObjectMessage
            && ((ObjectMessage) message).getObject() instanceof Exception) {
      exception = (Exception) ((ObjectMessage) message).getObject();
    } else if (message instanceof TextMessage) {
      exception = new UimaEEServiceException(((TextMessage) message).getText());
    }
    return exception;
  }
View Full Code Here

      Object object = aMessageContext.getObjectMessage();
      if (object == null) {
        // Could be a C++ exception. In this case the exception is just a String in the message
        // cargo
        if (aMessageContext.getStringMessage() != null) {
          object = new UimaEEServiceException(aMessageContext.getStringMessage());
        }
      }
      if (ignoreException(object)) {
        return;
      }
View Full Code Here

   * Sends a given CAS for analysis to the UIMA EE Service.
   *
   */
  public synchronized String sendCAS(CAS aCAS) throws ResourceProcessException {
    if ( !running ) {
      throw new ResourceProcessException(new UimaEEServiceException("Uima AS Client Has Been Stopped. Rejecting Request to Process CAS"));
    }
    return this.sendCAS(aCAS, produceNewClientRequestObject());
  }
View Full Code Here

    try {
      if (message instanceof ObjectMessage
              && ((ObjectMessage) message).getObject() instanceof Exception) {
        exception = (Exception) ((ObjectMessage) message).getObject();
      } else if (message instanceof TextMessage) {
        exception = new UimaEEServiceException(((TextMessage) message).getText());
      }
    } catch( Exception e) {
      UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, getClass().getName(),
              "retrieveExceptionFromMessage", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
              "UIMAEE_exception__WARNING", e);  
      exception = new UimaEEServiceException("UIMA AS client is unable to de-serialize Exception from a remote service",e);
    }
    return exception;
  }
View Full Code Here

      Throwable wrapper = null;
      Throwable cause = casStateEntry.getErrors().get(0);
      if (!(cause instanceof UimaEEServiceException)) {
        // Strip off AsyncAEException and replace with UimaEEServiceException
        if (cause instanceof AsynchAEException && cause.getCause() != null) {
          wrapper = new UimaEEServiceException(cause.getCause());
        } else {
          wrapper = new UimaEEServiceException(cause);
        }
      }
      if (wrapper == null) {
        message.addObjectProperty(AsynchAEMessage.Cargo, cause);
      } else {
View Full Code Here

TOP

Related Classes of org.apache.uima.aae.error.UimaEEServiceException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.