Solved

RMI Exception

Posted on 2000-05-12
3
281 Views
Last Modified: 2013-12-29
I'm getting an UnMarshallException while i'm running the RMI Server. It's a simple code i don't know why is it come.
I'm having both client & server on the same machine.

public interface server extends Remote{
  public void getvalue()throws RemoteException;
}

serverImpl
---------
public class ServerImpl extends UnicastRemoteObject implements server{
public ServerImpl() throws RemoteException{
   super();
}//const
public static void main(String[] args){
  try{
   ServerImpl ins = new ServerImpl();
   Naming.rebind("myserv",ins);
System.out.println("registered");
  }
  catch(Exception e){System.out.println(e.getMessage();}
}//main

}

c:\javac ServerImpl.java
c:\rmic ServerImpl
c:\java ServerImpl
0
Comment
Question by:jaki_77
3 Comments
 
LVL 7

Expert Comment

by:Ravindra76
ID: 2804803

Instead of e.getMessage(),

give e.printStackTrace() and give the fll exception details
0
 
LVL 3

Accepted Solution

by:
Laminamia063099 earned 100 total points
ID: 2805226
First, you have to start the rmi-registry:
c:\rmiregistry

Also, make sure that the stub and skeleton class files are found in your classpath before you do this.

Laminamia :)
0
 

Author Comment

by:jaki_77
ID: 2806623
actullay i've included some thing in that code i've cleared that error.

that's given below

Naming.rebind("myserv",ins); instead of this i've changed this to
Naming.bind("//localhost/myserv",ins);

i got correctly


0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This video teaches viewers about errors in exception handling.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now