java.rmi
Class RemoteException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.io.IOException
              extended by java.rmi.RemoteException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AccessException, ActivateFailedException, ActivityCompletedException, ActivityRequiredException, ConnectException, ConnectIOException, ExportException, InvalidActivityException, InvalidTransactionException, MarshalException, NoSuchObjectException, ServerError, ServerException, ServerRuntimeException, SkeletonMismatchException, SkeletonNotFoundException, StubNotFoundException, TransactionRequiredException, TransactionRolledbackException, UnexpectedException, UnknownHostException, UnmarshalException

public class RemoteException
extends IOException

The superclass of exceptions related to RMI (remote method invocation). Classes that implement java.rmi.Remote should list this exception in their throws clause.

Since:
1.1
See Also:
Serialized Form

Field Summary
 Throwable detail
          The cause of this exception.
 
Constructor Summary
RemoteException()
          Create an exception with no message, and cause initialized to null.
RemoteException(String s)
          Create an exception with the given message, and cause initialized to null.
RemoteException(String s, Throwable e)
          Create an exception with the given message and cause.
 
Method Summary
 Throwable getCause()
          Returns the cause of this exception.
 String getMessage()
          This method returns a message indicating what went wrong, in this format: super.getMessage() + (detail == null ?
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

detail

public Throwable detail
The cause of this exception. This pre-dates the exception chaining of Throwable; and although you can change this field, you are wiser to leave it alone.

Constructor Detail

RemoteException

public RemoteException()
Create an exception with no message, and cause initialized to null.


RemoteException

public RemoteException(String s)
Create an exception with the given message, and cause initialized to null.

Parameters:
s - the message

RemoteException

public RemoteException(String s,
                       Throwable e)
Create an exception with the given message and cause.

Parameters:
s - the message
e - the cause
Method Detail

getMessage

public String getMessage()
This method returns a message indicating what went wrong, in this format: super.getMessage() + (detail == null ? "" : "; nested exception is:\n\t" + detail).

Overrides:
getMessage in class Throwable
Returns:
the chained message

getCause

public Throwable getCause()
Returns the cause of this exception. Note that this may not be the original cause, thanks to the detail field being public and non-final (yuck). However, to avoid violating the contract of Throwable.getCause(), this returns null if detail == this, as no exception can be its own cause.

Overrides:
getCause in class Throwable
Returns:
the cause
Since:
1.4