[EMAIL PROTECTED] wrote:
>
> Here is a smaller test case of the situation i am having difficulty with.
> It is in a jar format
> with the beans in three packages
> foobar - the top level Session and Entity bean, FooBar and FooBarItem
> respectively
> foo - the low level entity bean FooItem
> bar - the low level entity bean Baritem
>
> It is not commented as it might expose some propriatary concepts i am
> working on.
> If you need more please ask and i will provide the necessary information.
>
> I will explain what is causing the error. I hope that is sufficient.
>
> First: A client application is provided that calls the Session EJB FooBar
> with the method in the Home Interface findMark with the mark to find within
> the server.
>
> This method calls FooBarItem to find the parents of the objects we are
> looking for through
> the finder method ejbFindByMark. If a parent has the mark so will at least
> one of the children.
> FindByMark calls a private method called getChildren that returns an
> enumeration of the children
> of each FooBar item. When we get the enumeration we itterate through it and
> find the children
> that have the supplied mark. We package the children into a vector and
> return. The exception
> occurs somewhere after the return of the finder method ejbFindByMark in the
> FooBarItem bean
> and the continuation of the findMark method in the FooBar bean.
>
> FooItem and BarItem implements a method in it's Home interface called
> ejbFindByEventId.
> This method creates an Enumeration of children to pass back to the
> FooBarItem bean.
>
> To run the example -
> Set up database -
> include foobar/FooBar.sql
> include foo.Foo.sql
> include bar.Bar.sql
>
> Compile the client findMark.java
> Execute the client with
> java findMark 64
>
> Thanks in advance
>
Hi,
It seems that the problem is in your ejbFindByMark(int mark ) method
of your FooBarItemBean Entity Bean BMP.
An ejbFind method must return the entity bean's primary key type or a
collection
of primary keys
in your code you return a Vector of Notifiable object, you must return
a collection of com.mbassociates.foobar.FooBarItemPK object.
If you look at the generated code in JOnASFooBarItemBeanHome you will
see
in findByMark(int p1) :
java.util.Collection pkC = eb.ejbFindByMark(p1);
java.util.Iterator pkIC = pkC.iterator();
while (pkIC.hasNext()) {
pk = (com.mbassociates.foobar.FooBarItemPK)pkIC.next();
....
...
the ClassCastException is raised here.
Best regards,
--
Philippe
Philippe Coq Evidian Phone: (33) 04 76 29 78 49
Bull S.A - 1 rue de Provence - 38432 Echirolles Cedex France
Download our EJBServer at http://www.objectweb.org
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".