� An enterprise bean must not attempt to listen on a socket, accept connections on a socket, or use a socket for multicast.
The EJB architecture allows an enterprise bean instance to be a network socket client, but it does not allow it to be a network server. Allowing the instance to become a network server would conflict with the basic function of the enterprise bean� to serve the EJB clients.
Cheers, Martijn,
Twitter.
Originally posted by Bupjae Lee:
You want to make some ejb "listening" on a socket?
Unfortunately, listening on a socket is prohibited in the EJB container.
I quote from Specification of Enterprise JavaBeans 3.0 Final release
Originally posted by Bupjae Lee:
You want to make some ejb "listening" on a socket?
By the way, why do you want to listening on the socket, instead of obtaining remote enterprise bean and calling business method?
Cheers, Martijn,
Twitter.
Originally posted by Raga Vendran:
Thanks for the response.
Is it possible by any other means ?
May be can we listen to a socket from a servlet and then the servlet making the ejb call ?
Thanks
Ragavendran
Cheers, Martijn,
Twitter.
Originally posted by Martijn Verburg:
Hi there,
Many ways you could tackle this! A couple of questions first:
1.) What version of EJB are you using?
EJB 2.0
2.) Are you in control of the client as well? (It _might_ be easier if the client could post to a JMS topic/queue or to a Webservice).
Then again after re-reading your post, it indicates that your client can't make EJB calls directly, so I assume you can't alter the client?
Yes you are correct. I can't alter my client.
A couple of Hints:
1.) Look at Message Driven Beans (more importantly the concepts around them, as an MDB isn't the direct solution here)
2.) Look at the ServerSocket class and associated networking APIs around it
Hope some of that helps!
PS: I've found OReilly Java Network Programming book to be very useful in this area.
[ September 02, 2008: Message edited by: Martijn Verburg ]
Originally posted by Raga Vendran:
3. Resource Adapter (JCA) ?? As Martijn pointed out in his post. Can you send some links which explains the usage.
Cheers, Martijn,
Twitter.
The only cure for that is hours of television radiation. And this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|