Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error while trying to generate stub file

Tags:

java

stub

rmi

When i try to generate a stub file using :rmic RemoteMethodImpl I get the following error :

error: File .\RemoteMethodImpl.class does not contain type RemoteMethodImpl as expected, but type InterfaceImplementation.RemoteMethodImpl. Please remove the file, or make sure it appears in the correct subdirectory of the class path.
error: Class RemoteMethodImpl not found.
2 errors

What error is this ? Why do i get this ?

Upon the request of @ Shashank Kadne

package InterfaceImplementation;
import Interfaces.RemoteMethodIntf;
import java.rmi.server.UnicastRemoteObject;
import java.rmi.RemoteException;
import Design.Main_Design_Client;
/**
 *
 * @author program-o-steve
 */
 public class RemoteMethodImpl extends UnicastRemoteObject implements RemoteMethodIntf{
  public RemoteMethodImpl() throws Exception{}   

@Override
public void send(String IP,String Message) throws RemoteException {
  Main_Design_Client mdc = new Main_Design_Client();
  mdc.jTextArea1.setText("<html><b>Message from :</b></html>" + IP);
  mdc.jTextArea1.setText("<html><b>Message :</b></html>" + Message);
}

}

like image 830
program-o-steve Avatar asked Mar 29 '26 17:03

program-o-steve


1 Answers

I am assuming you are in a directory just outside "InterfaceImplementation" folder.

Execute : rmic InterfaceImplementation.RemoteMethodImpl

like image 60
Shashank Kadne Avatar answered Apr 01 '26 08:04

Shashank Kadne



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!