Package org.apache.uima.resource

Examples of org.apache.uima.resource.ResourceServiceException


            e.printStackTrace();
          }
        }
      }
    } catch (ResourceProcessException e) {
      throw new ResourceServiceException(e);
    }
  }
View Full Code Here


        ((ProcessingResourceMetaData)rmd).getOperationalProperties().setMultipleDeploymentAllowed(true);
        return rmd;
      }
     
    } catch (ResourceInitializationException e) {
      throw new ResourceServiceException(e);
    }
   
    throw new ResourceServiceException(new Exception("Uima AS getMetaData() call failed."));
  }
View Full Code Here

        if (tries-- > 0) {
          UIMAFramework.getLogger().log(Level.INFO, "Retrying callProcess on remote AS service...");
          continue;
        }
        if (!ignoreErrors) {
          throw new ResourceServiceException(e);
        }
      }
    }
  }
View Full Code Here

            }
          }
        }
      }
    } catch (ResourceProcessException e) {
      throw new ResourceServiceException(e);
    }
  }
View Full Code Here

        ((ProcessingResourceMetaData)rmd).getOperationalProperties().setMultipleDeploymentAllowed(true);
        return rmd;
      }
     
    } catch (ResourceInitializationException e) {
      throw new ResourceServiceException(e);
    }
   
    throw new ResourceServiceException(new Exception("Uima AS getMetaData() call failed."));
  }
View Full Code Here

        if (tries-- > 0) {
          UIMAFramework.getLogger().log(Level.INFO, "Retrying callProcess on remote AS service...");
          continue;
        }
        if (!ignoreErrors) {
          throw new ResourceServiceException(e);
        }
      }
    }
  }
View Full Code Here

            }
          }
        }
      }
    } catch (ResourceProcessException e) {
      throw new ResourceServiceException(e);
    }
  }
View Full Code Here

      call.registerTypeMapping(ResourceMetaData.class, mResourceMetaDataTypeQName,
              new XmlSerializerFactory(), new XmlDeserializerFactory());

      return (AnalysisEngineMetaData) call.invoke(new Object[0]);
    } catch (ServiceException e) {
      throw new ResourceServiceException(e);
    } catch (java.rmi.RemoteException e) {
      throw new ResourceServiceException(e);
    }
  }
View Full Code Here

          Object content = dataHandler.getContent();
          // System.out.println(content.getClass().getName());
          objStream = new ObjectInputStream((InputStream) content);
          resultCargo = (ServiceDataCargo) objStream.readObject();
        } catch (IOException e) {
          throw new ResourceServiceException(e);
        } catch (ClassNotFoundException e) {
          throw new ResourceServiceException(e);
        } finally {
          if (objStream != null) {
            try {
              objStream.close();
            } catch (IOException e) {
              throw new ResourceServiceException(e);
            }
          }
        }
      } else if (result instanceof ServiceDataCargo) // direct return
      {
        resultCargo = (ServiceDataCargo) result;
      } else {
        throw new ResourceServiceException(
                ResourceServiceException.UNEXPECTED_SERVICE_RETURN_VALUE_TYPE, new Object[] {
                    ServiceDataCargo.class.getName(),
                    resultCargo == null ? "null" : resultCargo.getClass().getName() });
      }

      // unmarshal analysis results into the original AnalysisProcessData object
      // (do not replace CAS type system, as it should not have been changed
      // by the service)
      resultCargo.unmarshalCas(aCAS, false);
    } catch (ServiceException e) {
      throw new ResourceServiceException(e);
    } catch (java.rmi.RemoteException e) {
      throw new ResourceServiceException(e);
    } catch (CASException e) {
      throw new ResourceServiceException(e);
    }
  }
View Full Code Here

    try {
      // get CAS instance from pool
      cas = getCasFromPool(mTimeout);

      if (cas == null) {
        throw new ResourceServiceException(ResourceServiceException.RESOURCE_UNAVAILABLE,
                new Object[0]);
      }

      // deserialize CAS data into this CAS instance
      aData.unmarshalCas(cas, true);

      // run the AnalysisEngine's process method
      getAnalysisEngine().process(cas, aResultSpec, trace);

      // return results
      return new ServiceDataCargo(cas, trace);
    } catch (Exception e) {
      resultMessage = e.getLocalizedMessage();
      if (e instanceof ResourceServiceException) {
        throw (ResourceServiceException) e;
      } else {
        throw new ResourceServiceException(e);
      }
    } finally {
      // release CAS
      if (cas != null) {
        getCasPool().releaseCas(cas);
View Full Code Here

TOP

Related Classes of org.apache.uima.resource.ResourceServiceException

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.