*
* @throws Exception
* If some error occurs.
*/
private void initServer() throws Exception {
MyRemoteObject obj = new MyRemoteObject();
System.err.println("Object: " + obj + " created and exported.");
Registry reg = LocateRegistry.createRegistry(REGISTRY_PORT);
exportedObjects.add(reg);
System.err.println("Registry created.");
reg.bind("MyRemoteObject", RemoteObject.toStub(obj));