public int sum() throws RemoteException{ return sum; } public void sum(int _val) throws RemoteException{ sum = _val; } public int increment() throws RemoteException{ return ++sum; }
Implementation class, when I compile both and run rmic CountRMImpl I got the following error,
public class CountRMImpl extends UnicastRemoteObject implements CountRMI ^ Error is stated at CountRMI please help me to over come this.
The problem is with the packaging. If you type 'rmic <CLASSNAME>', it will not work because this class is packaged. Instead, go to the base directory of package (where your 'com' directory is), then type 'rmic com.rmi.CountRMImpl'. It will execute the rmi compiler.
Also, there are no "skeletons" in the new RMI, only "stubs". Even though many books use the concept of stub & skeleton for descriptions, in the when you execute rmic, it will only create a stub, which is named as "<classname>_Stub.class".