You must cast to InterfaceNotaRecibo not NotaRecibo.

> -----Original Message-----
> From: Glauber Andrade [mailto:[EMAIL PROTECTED]
> Sent: 26 November 2003 15:28
> To: [EMAIL PROTECTED]
> Subject: proxy ClassCastException
> Importance: High
> 
> 
> I am trying to use proxy (my first time) and I am getting a
> ClassCastException.
> What do I need to do? How do I cast ?
> Thanks,
> 
> Glauber
> 
> ////////////////////////////////////
>       Query q = QueryFactory.newQuery(NotaRecibo.class, crit);
>       Collection c = broker.getCollectionByQuery(q);
>       Iterator iter = c.iterator();
>       Object[][] data = new Object[c.size()][17];
>       NotaRecibo nota = null;
>       while (iter.hasNext()) {
>          nota = (NotaRecibo) iter.next();    ===> ClassCastException
>          ...
> ////////////////////////////////////
>    <class-descriptor
>       class="com......data.NotaRecibo"
>      proxy="dynamic"
>       table="notasrecibos"
>    >
> ...
> ////////////////////////////////////
> public interface InterfaceNotaRecibo {
> ...
> ////////////////////////////////////
> public class NotaRecibo implements InterfaceNotaRecibo {
> ...
> ////////////////////////////////////
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


___________________________________________________________
HPD Software Ltd. - Helping Business Finance Business
Email terms and conditions: www.hpdsoftware.com/disclaimer 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to