Package org.apache.openejb

Examples of org.apache.openejb.SystemException


            if (xaResource != null && mdbCallContext.txPolicy.isNewTransaction()) {
                mdbCallContext.txPolicy.enlistResource(xaResource);
            }
        } catch (ApplicationException e) {
            ThreadContext.exit(oldContext);
            throw new SystemException("Should never get an Application exception", e);
        } catch (SystemException e) {
            ThreadContext.exit(oldContext);
            throw e;
        } catch (Exception e) {
            ThreadContext.exit(oldContext);
            throw new SystemException("Unable to enlist xa resource in the transaction", e);
        }
    }
View Full Code Here


        // invoke the tx after method
        try {
            afterInvoke(mdbCallContext.txPolicy, callContext);
        } catch (ApplicationException e) {
            throw new SystemException("Should never get an Application exception", e);
        } finally {
            ThreadContext.exit(mdbCallContext.oldCallContext);
        }
    }
View Full Code Here

        }
    }

    private Instance obtainInstance(Object primaryKey, ThreadContext callContext, Method callMethod) throws OpenEJBException {
        if (primaryKey == null) {
            throw new SystemException(new NullPointerException("Cannot obtain an instance of the stateful session bean with a null session id"));
        }

        Transaction currentTransaction = getTransaction(callContext);

        // Find the instance
        Instance instance;
        synchronized (primaryKey) {
            instance = checkedOutInstances.get(primaryKey);
            if (instance == null) {
                try {
                    instance = cache.checkOut(primaryKey);
                } catch (OpenEJBException e) {
                    throw e;
                } catch (Exception e) {
                    throw new SystemException("Unexpected load exception", e);
                }

                // Did we find the instance?
                if (instance == null) {
                    throw new InvalidateReferenceException(new NoSuchObjectException("Not Found"));
View Full Code Here

                masterTable.put(id, lastPointer);
                ras.write(bytes);
            }
            ras.close();
        } catch (final Exception e) {
            throw new SystemException(e);
        }
    }
View Full Code Here

            ras.seek(pointer.filepointer);
            ras.readFully(bytes);
            ras.close();
            return Serializer.deserialize(bytes);
        } catch (final Exception e) {
            throw new SystemException(e);
        }

    }
View Full Code Here

            }

            logger.info("Using directory " + sessionDirectory + " for stateful session passivation");

        } catch (final IOException e) {
            throw new SystemException(getClass().getName() + ".init(): can't use directory prefix " + dir + ":" + e, e);
        }
    }
View Full Code Here

                IO.close(oos);
            }

        } catch (final NotSerializableException nse) {
            logger.error("Passivation failed ", nse);
            throw (SystemException) new SystemException("The type " + nse.getMessage() + " is not serializable as mandated by the EJB specification.").initCause(nse);
        } catch (final Exception t) {
            logger.error("Passivation failed ", t);
            throw new SystemException(t);
        }
    }
View Full Code Here

                return null;
            }
        } catch (final Exception t) {
            logger.info("Activation failed ", t);

            throw new SystemException(t);
        }
    }
View Full Code Here

    }

    @SuppressWarnings("LockAcquiredButNotSafelyReleased")
    private Instance obtainInstance(final Object primaryKey, final ThreadContext callContext, final Method callMethod, final boolean checkOutIfNecessary) throws OpenEJBException {
        if (primaryKey == null) {
            throw new SystemException(new NullPointerException("Cannot obtain an instance of the stateful session bean with a null session id"));
        }

        final Transaction currentTransaction = getTransaction(callContext);

        // Find the instance
        Instance instance;
        synchronized (this) {
            instance = checkedOutInstances.get(primaryKey);
            if (instance == null) { // no need to check for extended persistence contexts it shouldn't happen
                try {
                    instance = cache.checkOut(primaryKey, checkOutIfNecessary);
                } catch (final OpenEJBException e) {
                    throw e;
                } catch (final Exception e) {
                    throw new SystemException("Unexpected load exception", e);
                }

                // Did we find the instance?
                if (instance == null) {
                    throw new InvalidateReferenceException(new NoSuchObjectException("Not Found"));
View Full Code Here

                throw new ApplicationException(new RemoteException("Transactions not supported"));
            }

        } catch (javax.transaction.SystemException se) {
            logger.error("Exception during getTransaction()", se);
            throw new SystemException(se);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.openejb.SystemException

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.