help on finder method?


EJB programming & troubleshooting: help on finder method?

  1. help on finder method? (2 messages)

    I define a findAll() method in home interface which return a collection and implemt ejbFindAll() method which put keys into a Vector.While I iterate the objects in EJB client,the object can't cast to remote interface type.

    client code:
    Remote r=(Remote);
    The exception is:ClassCastException

    I use JBuilder5.0 as IDE and BAS4.5 as application server.I don't know why and hope some one could direct me.Thanks in advance

    Best Regards

    Threaded Messages (2)

  2. help on finder method?[ Go to top ]

    Sorry,I have found the cause,it's JBuilder's misdirection.We should use PortableRemoteObject.narrow rather than simple type casting.
  3. help on finder method?[ Go to top ]

    Do not impement that finder method in the bean,these methods are taken care care by the container.

    Regarding the code in the Client Application,do check UR code properly.
    First of all finder methods returns a Remote interface or
    an Enumeration.
    So first Enumerate N then iterate .