• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Unable to find Skeleton in the rmi invokation

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Friends,
I used one interface and implementation class to invoke RMI they are as follows

package com.rmi;
import java.rmi.Remote;
public interface CountRMI extends Remote {

public int sum() throws java.rmi.RemoteException;
public void sum(int _val) throws java.rmi.RemoteException;
public int increment() throws java.rmi.RemoteException;
}

package com.rmi;
import java.rmi.server.UnicastRemoteObject;
import java.rmi.*;


public class CountRMImpl extends UnicastRemoteObject implements CountRMI {
private int sum;

public CountRMImpl(String name) throws RemoteException{
super();
try{
Naming.rebind(name, this);
sum=0;
}
catch(Exception e){
System.out.println("Exception:" + e.getMessage());
e.printStackTrace();
}
}

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.

Thanks,
Bhargavi.
 
Ranch Hand
Posts: 132
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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".

Hope this will solve your problem.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic