Callback from a stateful bean
I have a problem performing callback from a session stateful EJB. I have defined
an interface with a single unimplemented method onMessage in it, and an abstract
class that implements this interface. The abstract class is extended by another
class, a broker. In the broker I have fully implemented the method onMessage defined
in the interface. The broker calls a method in the EJB passing its reference,
subscribing itself as a listener. When needed, the EJB calls the onMessage method
of the listener, that in this case is the broker. The method is correctly invoked
and the code in it is executed, BUT it seems the control is not really passed
to the broker: the EJB itself seems to be executing the broker code... Note that
broker and EJB are in differents EAR.
Infact there are problems of ClassCastException when, in the broker onMessage
method, are called some other EJBs present in the broker EAR but not present in
the EJB EAR. It seems the classloader after the callback is the EJB classloader
and no more the broker classloader!
I'm only calling a method defined in an interface as a callback method...
Re: Callback from a stateful bean
"Bran" <firstname.lastname@example.org> wrote in message news:email@example.com...[color=blue]
> I'm only calling a method defined in an interface as a callback method...
> Some hypothesis??[/color]
Each EAR receives it's own classloader, so objects are passsed
always by value to EJBs in different EARs.