You may need:

     tmpE = (e)javax.rmi.PortableRemoteObject.narrow(enumE.nextElement(), E.class);

Check the EJB spec where it talks about PortableRemoteObject.narrow.

Fernando Santos wrote:
>
> Hi,
>
> I have created an CMP Bean 'E' from a schema on VisualAge for Java.
> I defined in my home interface the findAll() that returns an Enumeration, as
> explained on source comments of EBeanFinderHelper class generated by
> VisualAge, and also the respective findAllQueryString in EBeanFinderHelper
> class.
> In my session bean 'S' I have something similar to:
>
> E tmpE = null;
>
> enumE = EHome.findAll();
>
> while (enumE.hasMoreElements()) {
>     tmpE = (E) enumE.nextElement();
>     ...
> }
>
> When I run 'S' on the test environment provided by VA then it throws a
> java.lang.ClassCastException exception.
> Can someone tell me what I'am doing wrong?
>
> The findByPrimaryKey() works with no problems.
> When I test the 'X' I don't have problems, returning all records in the
> Enumeration.
>
> Thanks in advance,
> Fernando.
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

--
________________________________________________________________________________

Evan Ireland              Sybase EAServer Engineering        [EMAIL PROTECTED]
                            Wellington, New Zealand               +64 4 934-5856

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to