Example usage for java.rmi.server ExportException getMessage

List of usage examples for java.rmi.server ExportException getMessage

Introduction

In this page you can find the example usage for java.rmi.server ExportException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message, including the message from the cause, if any, of this exception.

Usage

From source file:net.sf.ehcache.distribution.RMICacheManagerPeerListener.java

/**
 * Start the rmiregistry./*from  w  w  w  .j  a v a  2s  .co m*/
 * <p/>
 * The alternative is to use the <code>rmiregistry</code> binary, in which case:
 * <ol/>
 * <li>rmiregistry running
 * <li>-Djava.rmi.server.codebase="file:///Users/gluck/work/ehcache/build/classes/ file:///Users/gluck/work/ehcache/lib/commons-logging-1.0.4.jar"
 * </ol>
 *
 * @throws RemoteException
 */
protected void startRegistry() throws RemoteException {
    try {
        registry = LocateRegistry.getRegistry(port.intValue());
        try {
            registry.list();
        } catch (RemoteException e) {
            //may not be created. Let's create it.
            registry = LocateRegistry.createRegistry(port.intValue());
            registryCreated = true;
        }
    } catch (ExportException exception) {
        LOG.fatal("Exception starting RMI registry. Error was " + exception.getMessage(), exception);
    }
}