Package java.rmi

Examples of java.rmi.UnmarshalException


            ObjectInput in;
            try {
                in = call.getInputStream();
                hash = in.readLong();
            } catch (Exception readEx) {
                throw new UnmarshalException("error unmarshalling call header",
                                             readEx);
            }

            // if calls are being logged, write out object id and operation
            logCall(obj, skel.getOperations()[op]);
View Full Code Here


    fromImpl = true;
      }
  } catch (RuntimeException e) {
      t = e;
  } catch (Exception e) {
      t = new UnmarshalException("unmarshalling method/arguments", e);
  } catch (Throwable tt) {
      t = tt;
  } finally {
      if (in != null) {
    try {
View Full Code Here

        try {
            // read input
            if ((data = (new DataInputStream(conn.getInputStream())).readByte())
                    != CALL_OK) {
                // rmi.39=Unknown call status response: {0}
                throw new UnmarshalException(Messages.getString("rmi.39", data)); //$NON-NLS-1$
            }

            // read return value id
            getInputStream();
            data = oin.readByte();
        } catch (UnmarshalException re) {
            throw re;
        } catch (IOException ioe) {
            // rmi.3A=Unable to read call return header:
            throw new UnmarshalException(Messages.getString("rmi.3A"), //$NON-NLS-1$
                    ioe);
        }

        if (data != RETURN_VAL && data != RETURN_EX) {
            // rmi.3B=Unknown call result response: {0}
            throw new UnmarshalException(Messages.getString("rmi.3B", data)); //$NON-NLS-1$
        }
        uid = UID.read(oin);

        if (data == RETURN_EX) {
            getExceptionFromServer();
View Full Code Here

        try {
            obj = oin.readObject();
        } catch (IOException ioe) {
            // rmi.3C=IOException occurred while unmarshalling returned exception
            throw new UnmarshalException(Messages.getString("rmi.3C"), ioe); //$NON-NLS-1$
                   
        } catch (ClassNotFoundException cnfe) {
            // rmi.3D=ClassNotFoundException occurred while unmarshalling returned exception
            throw new UnmarshalException(Messages.getString("rmi.3D"), cnfe); //$NON-NLS-1$
        }

        if (obj instanceof Exception) {
            Exception resEx = (Exception) obj;
View Full Code Here

            // read RMI header
            int header = din.readInt();

            if (header != RMI_HEADER) {
                // rmi.82=Unknown header: {0}
                throw new UnmarshalException(Messages.getString("rmi.82", header)); //$NON-NLS-1$
            }

            // read RMI protocol version
            short ver = din.readShort();

            if (ver != PROTOCOL_VER) {
                // rmi.83=Unknown RMI protocol version: {0}
                throw new UnmarshalException(Messages.getString("rmi.83", ver)); //$NON-NLS-1$
            }
        } catch (IOException ioe) {
            // rmi.84=Unable to read RMI protocol header
            throw new UnmarshalException(Messages.getString("rmi.84"), //$NON-NLS-1$
                    ioe);
        }

        if (tcpTransportLog.isLoggable(RMILog.VERBOSE)) {
            // rmi.85=Using protocol version {0}
View Full Code Here

    /**
     * {@link java.rmi.UnmarshalException#UnmarshalException(java.lang.String, java.lang.Exception)}.
     */
    public void testUnmarshalExceptionStringException() {
        NullPointerException npe = new NullPointerException();
        UnmarshalException e = new UnmarshalException("fixture", npe);
        assertTrue(e.getMessage().indexOf("fixture") > -1);
        assertSame(npe, e.getCause());
        assertSame(npe, e.detail);
    }
View Full Code Here

    /**
     * {@link java.rmi.UnmarshalException#UnmarshalException(java.lang.String)}.
     */
    public void testUnmarshalExceptionString() {
        UnmarshalException e = new UnmarshalException("fixture");
        assertEquals("fixture", e.getMessage());
        assertNull(e.getCause());
        assertNull(e.detail);
    }
View Full Code Here

       /* 02) any instance of java.rmi.UnmarshalException in which the
          value of the exception's detail field is an instance of
          java.io.ObjectStreamException */
       badInvException02 =
     new UnmarshalException("LeaseExpirationTest",
      new StreamCorruptedException("LeaseExpirationTest"));
       badInvOwner02 =
     new FailingOpCountingOwner(badInvException02, 0, renewGrant);

       /* 03) any instance of java.rmi.ServerException in which the
View Full Code Here

    // purposefully inherit javadoc from parent class
    protected Throwable[] createExceptionArray() {

       Throwable[] throwables = new Throwable[4];
       throwables[3] =
     new UnmarshalException("Second UnmarshalException");
       throwables[2] =
     new ConnectIOException("ConnectIOException");
       throwables[1] =
     new RemoteException("RemoteException");
       throwables[0] =
     new UnmarshalException("First UnmarshalException");

       return throwables;
    }
View Full Code Here

       throwArray[2] =
     new ConnectIOException("ConnectIOException");
       throwArray[1] =
     new RemoteException("RemoteException");
       throwArray[0] =
     new UnmarshalException("UnmarshalException");

       return throwArray;
    }
View Full Code Here

TOP

Related Classes of java.rmi.UnmarshalException

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.