• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI - Transport return code invalid

 
Paul Smiley
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any idea what this means? I am looping 10 times on a RMI call and it gets 2 successfully, then throws this exception. I can't find anything anywhere on it.
java.rmi.UnmarshalException: Transport return code invalid
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at suncertify.rmi.RMIServerImpl_Stub.getDate(Unknown Source)
at suncertify.rmi.RMIClient.main(RMIClient.java:28)
My sample client code:
public static void main(String[] args) {
try{
if(System.getSecurityManager() == null){
System.setSecurityManager(new RMISecurityManager());
}
RMIServerIF serverIF = (RMIServerIF)Naming.lookup("rmi://localhost/MyName");
System.out.println("Object from server is " + serverIF.getName());
for(int i=0; i<10; i++){
System.out.println((serverIF.getDate()).getTime().toString());
}
}catch (Exception e){
e.printStackTrace();
}
return;
}
Thanks!
Paul
 
Satish Avadhanam
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul, I am assuming this is part of the assignment. I got a doubt regarding the use of security manager. My instructions specifically states:

You must not require the installation of a security manager.

I'm don't know much about RMI. So, does it mean we have to use security manager at the client side. It seems that you have used it at the client right. Can you help me understand the reason for using security manager?
Appreciate your help, Thanks.
 
Paul Smiley
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have used the security manager because I am getting socket permission errors if I don't. My assignment is old - and probably a different assignment from yours.
 
Satish Avadhanam
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul thanks for clarification. Sorry that I cannot help you as I don't know much about RMI or Sockets.
Thanks.
[ March 09, 2004: Message edited by: Satish Avadhanam ]
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12014
220
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,
Could you add a sleep statement into your loop and see if it behaves any better then? (Say 1/4 of a second or so). This may just be a timing issue - you are hammering the network to get those 10 calls through.
Regards, Andrew
 
Paul Smiley
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Andrew. I'll try that! Will let you know if it works.
 
Paul Smiley
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Worked like a charm. Good advice!
Changing OS's (ME to XP) and upgrading the J2SDK apparently makes it run faster - therefore the collisions.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic