// 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;