File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and Other Java EE Technologies and the fly likes Bean Talking to Other Server Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » EJB and Other Java EE Technologies
Reply Bookmark "Bean Talking to Other Server" Watch "Bean Talking to Other Server" New topic
Author

Bean Talking to Other Server

Ravi Verma
Ranch Hand

Joined: Aug 30, 2001
Posts: 42
Hi
I am in a situation where A Bean should talk to the other java based server and vice versa(back and forth) which is communication thru TCP(ServerSockets), My requirement is how to make them communicate to interchance the Data.
I am urgently need this help.
Thanks in Advance
Ravi
------------------
Ravi


Ravi
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 12513

What you want is a basic violation of the EJB architectural rules. There are a number of reasons why EJBs aren't allowed to use sockets and they're listed in the spec.
Aside from the technical reasons, EJBs are supposed to be callable components, not calling ones, except to be able to call other EJBs.
In general, any sort of socket services are supposed to be used by the EJB's client (often a servlet or JSP), not the EJB itself. There are 2 exceptions:
1. An EJB will implicitly use network facilities if invokes an EJB on another server. This is OK, because it uses the synchronous remote call mechanism of its container. The container is allowed things that the EJB itself is forbidden. One reason the EJB IS forbidden is to avoid damaging the internal contexts of the container.
2. In EJB2.0, a Message Driven Bean can be used for asynchronous services - this is a one-way trip, however.

One of the most odious afflictions that Business has inflicted on the modern English language is "pro-active". Most of the time it's simply redundantly used in place of the simple old word "active". And a good deal of the rest of the time it means "You're not overworked enough yet, so go out and find more!"
 
 
subject: Bean Talking to Other Server
 
Threads others viewed
Enabling Connection pretest in hibernate.cfg.xml
Dynamic Deployment Of Beans
Rational Rose for Part II: a good choice or some other tool?
How to Communicate other Server from Enterprise Bean
Enterprise Bean communicating java Serversocket
MyEclipse, The Clear Choice