Search in sources :

Example 26 with InvalidClassException

use of java.io.InvalidClassException in project adempiere by adempiere.

the class ServerProcessCtl method startDBProcess.

//  startProcess
/**************************************************************************
	 *  Start Database Process
	 *  @param ProcedureName PL/SQL procedure name
	 *  @return true if success
	 */
protected boolean startDBProcess(String ProcedureName) {
    //  execute on this thread/connection
    log.fine(ProcedureName + "(" + processInfo.getAD_PInstance_ID() + ")");
    boolean started = false;
    String trxName = trx != null ? trx.getTrxName() : null;
    if (isServerProcess) {
        Server server = CConnection.get().getServer();
        try {
            if (server != null) {
                //	See ServerBean
                processInfo = server.dbProcess(processInfo, ProcedureName);
                log.finest("server => " + processInfo);
                started = true;
            }
        } catch (UndeclaredThrowableException ex) {
            Throwable cause = ex.getCause();
            if (cause != null) {
                if (cause instanceof InvalidClassException)
                    log.log(Level.SEVERE, "Version Server <> Client: " + cause.toString() + " - " + processInfo, ex);
                else
                    log.log(Level.SEVERE, "AppsServer error(1b): " + cause.toString() + " - " + processInfo, ex);
            } else {
                log.log(Level.SEVERE, " AppsServer error(1) - " + processInfo, ex);
                cause = ex;
            }
            processInfo.setSummary(Msg.getMsg(Env.getCtx(), "ProcessRunError") + " " + cause.getLocalizedMessage());
            processInfo.setError(true);
            return false;
        } catch (Exception ex) {
            Throwable cause = ex.getCause();
            if (cause == null)
                cause = ex;
            log.log(Level.SEVERE, "AppsServer error - " + processInfo, cause);
            processInfo.setSummary(Msg.getMsg(Env.getCtx(), "ProcessRunError") + " " + cause.getLocalizedMessage());
            processInfo.setError(true);
            return false;
        }
    }
    //try locally
    if (!started) {
        if (processInfo.isManagedTransaction())
            return ProcessUtil.startDatabaseProcedure(processInfo, ProcedureName, trx);
        else
            return ProcessUtil.startDatabaseProcedure(processInfo, ProcedureName, trx, processInfo.isManagedTransaction());
    }
    return true;
}
Also used : Server(org.compiere.interfaces.Server) UndeclaredThrowableException(java.lang.reflect.UndeclaredThrowableException) InvalidClassException(java.io.InvalidClassException) UndeclaredThrowableException(java.lang.reflect.UndeclaredThrowableException) InvalidClassException(java.io.InvalidClassException)

Aggregations

InvalidClassException (java.io.InvalidClassException)26 ObjectInputStream (java.io.ObjectInputStream)10 ByteArrayInputStream (java.io.ByteArrayInputStream)9 IOException (java.io.IOException)9 BindingConfigParseException (org.openhab.model.item.binding.BindingConfigParseException)6 StreamCorruptedException (java.io.StreamCorruptedException)5 ByteArrayOutputStream (java.io.ByteArrayOutputStream)4 NotSerializableException (java.io.NotSerializableException)4 ObjectOutputStream (java.io.ObjectOutputStream)4 OptionalDataException (java.io.OptionalDataException)4 Serializable (java.io.Serializable)4 UndeclaredThrowableException (java.lang.reflect.UndeclaredThrowableException)4 Server (org.compiere.interfaces.Server)4 ObjectInputFilter (sun.misc.ObjectInputFilter)4 Test (org.testng.annotations.Test)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 UUID (java.util.UUID)2 EOFException (java.io.EOFException)1 FileInputStream (java.io.FileInputStream)1