Search in sources :

Example 86 with DataAccessException

use of org.vcell.util.DataAccessException in project vcell by virtualcell.

the class SimulationData method refreshLogFile.

/**
 * This method was created in VisualAge.
 */
private synchronized void refreshLogFile() throws DataAccessException {
    VCMongoMessage.sendTrace("SimulationData.refreshLogFile() <<ENTER>>");
    // 
    try {
        readLog(getLogFilePrivate());
    } catch (FileNotFoundException e) {
    } catch (IOException e) {
        e.printStackTrace(System.out);
        throw new DataAccessException(e.getMessage(), e);
    } catch (SecurityException e) {
        // Added because "new FileInputStream(...) throws security exception when file permissions wrong
        e.printStackTrace(System.out);
        throw new DataAccessException(e.getMessage(), e);
    } catch (RuntimeException e) {
        // log exceptions we are passing on
        e.printStackTrace(System.out);
        throw e;
    }
    VCMongoMessage.sendTrace("SimulationData.refreshLogFile() <<EXIT>>");
}
Also used : FileNotFoundException(java.io.FileNotFoundException) IOException(java.io.IOException) DataAccessException(org.vcell.util.DataAccessException)

Example 87 with DataAccessException

use of org.vcell.util.DataAccessException in project vcell by virtualcell.

the class SimulationData method refreshMeshFile.

/**
 * This method was created in VisualAge.
 */
private synchronized void refreshMeshFile() throws DataAccessException, MathException {
    // 
    // (re)read the log file if necessary
    // 
    VCMongoMessage.sendTrace("SimulationData.refreshMeshFile() <<BEGIN>>");
    try {
        readMesh(getMeshFile(), getMembraneMeshMetricsFile());
        VCMongoMessage.sendTrace("SimulationData.refreshMeshFile() <<EXIT normally>>");
    } catch (FileNotFoundException e) {
        VCMongoMessage.sendTrace("SimulationData.refreshMeshFile() <<EXIT-file not found>>");
    } catch (Exception e) {
        e.printStackTrace(System.out);
        VCMongoMessage.sendTrace("SimulationData.refreshMeshFile() <<EXIT-IOException>>");
        throw new DataAccessException(e.getMessage());
    }
}
Also used : FileNotFoundException(java.io.FileNotFoundException) FileNotFoundException(java.io.FileNotFoundException) XmlParseException(cbit.vcell.xml.XmlParseException) IOException(java.io.IOException) DataAccessException(org.vcell.util.DataAccessException) ExpressionException(cbit.vcell.parser.ExpressionException) MathException(cbit.vcell.math.MathException) DataAccessException(org.vcell.util.DataAccessException)

Example 88 with DataAccessException

use of org.vcell.util.DataAccessException in project vcell by virtualcell.

the class SimulationData method refreshDataProcessingOutputInfo.

private void refreshDataProcessingOutputInfo(OutputContext outputContext) throws DataAccessException {
    File dataProcessingOutputFile = getDataProcessingOutputSourceFileHDF5();
    if (dataProcessingOutputInfo == null && !dataProcessingOutputFile.exists()) {
        return;
    }
    AnnotatedFunction[] lastFunctions = (lastOutputContext == null ? null : lastOutputContext.getOutputFunctions());
    AnnotatedFunction[] currentFunctions = (outputContext == null ? null : outputContext.getOutputFunctions());
    boolean bFunctionsEqual = Compare.isEqualOrNull(lastFunctions, currentFunctions);
    if (!bFunctionsEqual || dataProcessingOutputInfo == null || lastDataProcessingOutputInfoTime != dataProcessingOutputFile.lastModified()) {
        lastDataProcessingOutputInfoTime = dataProcessingOutputFile.lastModified();
        lastOutputContext = outputContext;
        DataProcessingOutputInfoOP dataProcessingOutputInfoOP = new DataProcessingOutputInfoOP(vcDataId, false, outputContext);
        try {
            dataProcessingOutputInfo = (DataProcessingOutputInfo) DataSetControllerImpl.getDataProcessingOutput(dataProcessingOutputInfoOP, dataProcessingOutputFile);
        } catch (Exception e) {
            throw new DataAccessException(e.getMessage(), (e.getCause() == null ? e : e.getCause()));
        }
    }
}
Also used : ZipFile(org.apache.commons.compress.archivers.zip.ZipFile) File(java.io.File) DataProcessingOutputInfoOP(cbit.vcell.simdata.DataOperation.DataProcessingOutputInfoOP) FileNotFoundException(java.io.FileNotFoundException) XmlParseException(cbit.vcell.xml.XmlParseException) IOException(java.io.IOException) DataAccessException(org.vcell.util.DataAccessException) ExpressionException(cbit.vcell.parser.ExpressionException) MathException(cbit.vcell.math.MathException) DataAccessException(org.vcell.util.DataAccessException) AnnotatedFunction(cbit.vcell.solver.AnnotatedFunction)

Example 89 with DataAccessException

use of org.vcell.util.DataAccessException in project vcell by virtualcell.

the class SimulationData method getODEDataFile.

/**
 * This method was created in VisualAge.
 * @return File
 */
private synchronized File getODEDataFile() throws DataAccessException {
    refreshLogFile();
    if (dataFilenames == null) {
        throw new DataAccessException("ODE data filename not read from logfile");
    }
    File odeFile = amplistorHelper.getFile(dataFilenames[0]);
    if (odeFile.exists()) {
        return odeFile;
    }
    throw new DataAccessException("no results are available yet, please wait and try again...");
}
Also used : ZipFile(org.apache.commons.compress.archivers.zip.ZipFile) File(java.io.File) DataAccessException(org.vcell.util.DataAccessException)

Example 90 with DataAccessException

use of org.vcell.util.DataAccessException in project vcell by virtualcell.

the class SimulationData method getPDEDataSet.

/**
 * This method was created by a SmartGuide.
 * @return java.lang.String
 * @param time double
 */
private synchronized DataSet getPDEDataSet(File pdeFile, double time) throws DataAccessException {
    DataSet dataSet = new DataSet();
    File zipFile = null;
    try {
        zipFile = getPDEDataZipFile(time);
    } catch (DataAccessException ex) {
        zipFile = null;
    }
    try {
        dataSet.read(pdeFile, zipFile, amplistorHelper.solverDataType);
    } catch (IOException ex) {
        ex.printStackTrace();
        throw new DataAccessException("data at time=" + time + " read error", ex);
    }
    return dataSet;
}
Also used : IOException(java.io.IOException) ZipFile(org.apache.commons.compress.archivers.zip.ZipFile) File(java.io.File) DataAccessException(org.vcell.util.DataAccessException)

Aggregations

DataAccessException (org.vcell.util.DataAccessException)345 KeyValue (org.vcell.util.document.KeyValue)82 XmlParseException (cbit.vcell.xml.XmlParseException)80 ExpressionException (cbit.vcell.parser.ExpressionException)78 ObjectNotFoundException (org.vcell.util.ObjectNotFoundException)71 SQLException (java.sql.SQLException)67 IOException (java.io.IOException)60 MathException (cbit.vcell.math.MathException)59 RemoteProxyException (cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException)46 BigString (org.vcell.util.BigString)45 User (org.vcell.util.document.User)42 FileNotFoundException (java.io.FileNotFoundException)38 ResultSet (java.sql.ResultSet)38 PropertyVetoException (java.beans.PropertyVetoException)37 File (java.io.File)34 PermissionException (org.vcell.util.PermissionException)34 Statement (java.sql.Statement)33 ExpressionBindingException (cbit.vcell.parser.ExpressionBindingException)32 BioModelInfo (org.vcell.util.document.BioModelInfo)29 Vector (java.util.Vector)26