Package java.rmi

Examples of java.rmi.MarshalException


      throw (IOException) wae.detail;
    }
      } else if (org instanceof MarshalException) {
    // IIOP will throw MarshalException wrapping a NotSerializableException
    // when a server fails to serialize a response.
    MarshalException me = (MarshalException)org;
    if (me.detail instanceof NotSerializableException) {
        throw (NotSerializableException)me.detail;
    }
      }
View Full Code Here


        _invoker.invoke(invocation);
        MarshalledObject response;
        try {
            response = invocation.getMarshalledResponse();
        } catch (Exception exception) {
            throw new MarshalException("Failed to marshal response",
                                       exception);
        }
        return response;
    }
View Full Code Here

            // write the request
            out = new ObjectOutputStream(_out);
            request.write(out);
        } catch (IOException exception) {
            throw new MarshalException("Failed to marshal call", exception);
        } catch (Exception exception) {
            throw new MarshalException("Failed to marshal call", exception);
        } finally {
            if (out != null) {
                try {
                    out.close();
                } catch (IOException ignore) {
View Full Code Here

        MarshalledObject response;
        try {
            response = invocation.getMarshalledResponse();
        } catch (Exception exception) {
            throw new MarshalException("Failed to marshal response",
                                       exception);
        }
        return response;
    }
View Full Code Here

        try {
            TypeRepository rep = RMIState.current().getTypeRepository();
            CopyState state = new CopyState(rep);
            return state.copy(obj);
        } catch (CopyRecursionException ex) {
            throw new MarshalException("unable to resolve recursion", ex);
        } catch (org.omg.CORBA.SystemException ex) {
            throw mapSystemException(ex);
        }

    }
View Full Code Here

            TypeRepository rep = RMIState.current().getTypeRepository();
            CopyState state = new CopyState(rep);
            try {
                return (Object[]) state.copy(objs);
            } catch (CopyRecursionException ex) {
                throw new MarshalException("unable to resolve recursion", ex);
            }

            /*
             * int length = objs.length;
             *
 
View Full Code Here

        } else if (copyWithinState) {
            CopyState state = new CopyState(getTypeRepository());
            try {
                return state.copy(result);
            } catch (CopyRecursionException e) {
                throw new MarshalException("cannot copy recursive value?");
            }
        }

        return result;
    }
View Full Code Here

        String message = "CORBA " + corbaName + " " + ex.minor + " " + status;

        // Now map to the correct RemoteException type...
        if (ex instanceof COMM_FAILURE) {
            return new MarshalException(message, ex);
        } else if (ex instanceof INV_OBJREF) {
            RemoteException newEx = new NoSuchObjectException(message);
            newEx.detail = ex;
            return newEx;
        } else if (ex instanceof NO_PERMISSION) {
            return new AccessException(message, ex);
        } else if (ex instanceof MARSHAL) {
            return new MarshalException(message, ex);
        } else if (ex instanceof OBJECT_NOT_EXIST) {
            RemoteException newEx = new NoSuchObjectException(message);
            newEx.detail = ex;
            return newEx;
        } else if (ex instanceof TRANSACTION_REQUIRED) {
            RemoteException newEx = new TransactionRequiredException(message);
            newEx.detail = ex;
            return newEx;
        } else if (ex instanceof TRANSACTION_ROLLEDBACK) {
            RemoteException newEx = new TransactionRolledbackException(message);
            newEx.detail = ex;
            return newEx;
        } else if (ex instanceof INVALID_TRANSACTION) {
            RemoteException newEx = new InvalidTransactionException(message);
            newEx.detail = ex;
            return newEx;
        } else if (ex instanceof BAD_PARAM) {
            Exception inner = ex;

            // Pre-Merlin Sun ORBs used the incorrect minor code for
            // this case.  See Java to IDL ptc-00-01-08 1.4.8.
            if (ex.minor == ORBConstants.LEGACY_SUN_NOT_SERIALIZABLE ||
                ex.minor == OMGSystemException.NOT_SERIALIZABLE) {

                if (ex.getMessage() != null)
                    inner = new NotSerializableException(ex.getMessage());
                else
                    inner = new NotSerializableException();

                inner.initCause( ex ) ;
            }

            return new MarshalException(message,inner);
        } else if (ex instanceof ACTIVITY_REQUIRED) {
            try {
                Class cl = ORBClassLoader.loadClass(
                               "javax.activity.ActivityRequiredException");
                Class[] params = new Class[2];
View Full Code Here

        String message = "CORBA " + corbaName + " " + ex.minor + " " + status;

        // Now map to the correct RemoteException type...
        if (ex instanceof COMM_FAILURE) {
            return new MarshalException(message, ex);
        } else if (ex instanceof INV_OBJREF) {
            RemoteException newEx = new NoSuchObjectException(message);
            newEx.detail = ex;
            return newEx;
        } else if (ex instanceof NO_PERMISSION) {
            return new AccessException(message, ex);
        } else if (ex instanceof MARSHAL) {
            return new MarshalException(message, ex);
        } else if (ex instanceof OBJECT_NOT_EXIST) {
            RemoteException newEx = new NoSuchObjectException(message);
            newEx.detail = ex;
            return newEx;
        } else if (ex instanceof TRANSACTION_REQUIRED) {
            RemoteException newEx = new TransactionRequiredException(message);
            newEx.detail = ex;
            return newEx;
        } else if (ex instanceof TRANSACTION_ROLLEDBACK) {
            RemoteException newEx = new TransactionRolledbackException(message);
            newEx.detail = ex;
            return newEx;
        } else if (ex instanceof INVALID_TRANSACTION) {
            RemoteException newEx = new InvalidTransactionException(message);
            newEx.detail = ex;
            return newEx;
        } else if (ex instanceof BAD_PARAM) {
            Exception inner = ex;

            // Pre-Merlin Sun ORBs used the incorrect minor code for
            // this case.  See Java to IDL ptc-00-01-08 1.4.8.
            if (ex.minor == ORBConstants.LEGACY_SUN_NOT_SERIALIZABLE ||
                ex.minor == OMGSystemException.NOT_SERIALIZABLE) {

                if (ex.getMessage() != null)
                    inner = new NotSerializableException(ex.getMessage());
                else
                    inner = new NotSerializableException();

                inner.initCause( ex ) ;
            }

            return new MarshalException(message,inner);
        } else if (ex instanceof ACTIVITY_REQUIRED) {
            try {
                Class cl = ORBClassLoader.loadClass(
                               "javax.activity.ActivityRequiredException");
                Class[] params = new Class[2];
View Full Code Here

                        throw (IOException) wae.detail;
                }
            } else if (org instanceof MarshalException) {
                // IIOP will throw MarshalException wrapping a NotSerializableException
                // when a server fails to serialize a response.
                MarshalException me = (MarshalException)org;
                if (me.detail instanceof NotSerializableException) {
                    throw (NotSerializableException)me.detail;
                }
            }
View Full Code Here

TOP

Related Classes of java.rmi.MarshalException

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.