Jump to content

error

- - - - -

  • Please log in to reply
1 reply to this topic

#1
gcsekhar

gcsekhar

    Newbie

  • Members
  • PipPip
  • 14 posts
public class FibonacciClient

{

public static void main(Sring gcs[])

{

try

{

//remote object i //localhost:1099/fibonacci


Object o=Naming.lookup("rmi://localhost/fibonacci");

}

catch(Exception e)

{

e.printStackTrace();

}

}

}

above code is showing UnmarshallException at
Object o=Naming.lookup("");

what need to be changed

Edited by Roger, 15 January 2011 - 08:19 PM.


#2
Xylyze

Xylyze

    Newbie

  • Members
  • Pip
  • 8 posts
You need to pass it to an interface.

private FibonacciInterface fi;

fi = (FibonacciInterface) Naming.lookup("rmi://localhost/fibonacci");

Also, your interface needs to extend java.rmi.Remote.

This will work if you "just want your code to compile":

Object service;

try {

	service = (Object) Naming.lookup("rmi://localhost/fibonacci");

}






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users