Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ClassCastException

 
Peter Shipway
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello there,

The following statement is causing me a ClassCastException I have never seen this kind of error before and don�t quite know how to fix it.



I�m trying to create a distributed java RMI program that is capable of keeping a reference to itself and other instances of itself. (I.e. this one file is ran multiple times with different arguments in the command line)

Any help on this error would be greatly appreciated guys.

I just relized that I need to use the interface to refernce the RMI register instead, however I need to store a object of its own class in a list and I dont see how storing a list of the interfaces can help, is there a way that you can pull the "atucal" class from the register class?
[ October 09, 2006: Message edited by: Peter Shipway ]
 
Kedar Bhawarthi
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Given code doesnot seems to be enough to comment on, atleast provide stacktrace
 
Peter Shipway
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I have narrowed down the problem to what I think is me trying to get a refernce of an object from itself that implements interface through the interface object that is regiesterd in RMI, however when I attempt to do this I receive the ClassCastException error.

(I apologize for the large block of code but wanted to make it clear as possible)
[ October 11, 2006: Message edited by: Peter Shipway ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic