users@glassfish.java.net

Re: Problem with deserialization EJB Handle and getting remote EJBObject

From: <glassfish_at_javadesktop.org>
Date: Tue, 14 Oct 2008 12:43:10 PDT

> > I can't undestand one thing:
> > 1. I'm able to deserialize handle
> > 2. I'm able to get EJBHome (to which object? )
> > 3. I'm able to cast EJBHomeObject to my specific
> > class
> > 4. I not able to invoke create() method on home
> > interface to get instance of bean.
> >
>
> It's just an implementation detail that it happens to
> fail on the fourth step and not earlier.
> What is your use-case exactly? The handle
> functionality was not intended to preserve
> bean access after the application is undeployed.

One of my application's module is Dispatcher.
1. Dispatcher's client (SLSB) sends request to Dispatcher with passing own HomeHandle as argument
2. Dispatcher sends response that confirm request's accept.
3. Then dispatcher processes (asynchrously, using JMS) request and after receiving result try to "forward" it to client that has sent request.

The requirement is "Dispatcher's client must implement specific interface provided by Dispatcher". So Dispatcher needn't to know who it's client is.

I've tested it with Apache Geronimo and it worked fine in every scenario.

Of course, I could force SLSB to send set of information that is need to lookup it by Dispatcher like:
1) environment to construct Context
2) jndi-name to lookup remote business interface
but its all information depends on deployment environment (ports, jndi name) so I don't want to put it to application cause of need to change it on every server's configuration change.

Do you have any better solution ?

thank
Beniamin
[Message sent by forum member 'beniamin' (beniamin)]

http://forums.java.net/jive/thread.jspa?messageID=306934