This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
Here's the scenario.. App Server A has Entity Bean A App Server B has Entity Bean B App Server C has POJO C (acting as a DAO) I want the entity bean implementations to remain on their respective servers. I want C to access remote interfaces of A and B and perform typical CRUD operations on each. How does C access entities A and B? Do I need to have A and B code on App Server C? If so, how must it be packaged? All I was able to find out is how to configure the rmi.xml on each of the three servers so that they can communicate. That's as far as I got
First of all, you shouldn't access your entity beans through the Remote interface. You should use a session facade (client-->Session Bean-->Entity Bean) or message facade (if your system is asyncronous). From your server C you should access these Session Beans. How to do that depends on the App Server you are using...some may create a client.jar which (depending on the jars containing the EJBs) contains the stubs for your beans. It would be better for you if you look for an example of how to connect remotely to beans for your application server. And of course, you have the second option, telling us what app server you use and we might try and help.
...watch me...as I'm walking the path...
Joined: Oct 03, 2003
For simplicity's sake, I left out such details as Session Facades... but thanks for your input. Now, back on the topic of distribution. The app server is 9ias, but I didn't think that mattered, since distribution is part of the J2EE spec and thus applicable to all j2ee servers(?). I *did* find examples of how to put the entire ejb jar on a different server.. but what I want to do is somewhat different. I want to have some ejbs on one server and other ejbs on another server. I didn't find anything on how to configure that.
Hi Patrick, Well, if beans are on physically different servers then I would not try to access even the remote interfaces or session beans via session facade.. I would write a servlet on each app server that mediates b/w the external requests to access the beans and all and use may be urlconnection or something to pass around things...The reason is this enables us to change names or session beans or entity beans etc on different servers. NOw, I don't know how good idea is to make urlconnection ...but my point is to keep things separate/decoupled if they are physically separate.... Regards Maulin
Hi Maulin, >>Well, if beans are on physically different servers then I would not try to access even the remote interfaces or session beans via session facade.. >>I would write a servlet on each app server that mediates b/w the external requests to access the beans and all and use may be urlconnection or something to pass around things...The reason is this enables us to change names or session beans or entity beans etc on different servers. NOw, I don't know how good idea is to make urlconnection ...but my point is to keep things separate/decoupled if they are physically separate.... As per as Patrick's requirement any client on App Server C say has to access the 2 Entity Beans on App Server A and B respectively. Though this may not be the Clustered Server kind of an environment, still the return values of any business methods needs to be obtained and used in the App Server C's business method. Normal remote lookup for each of the Entity bean on the 2 app server should take care of the same though I have no code to prove it in actual as difficult to have a setup like this. Rgds, Seetesh
Joined: Feb 13, 2004
Hi Patrick, POJO on App Server C can access the 2 EB defined on the 2 App Servers A and B provided the 2 EB are defined as Remote and not Local. If u have already tried this, pls mention if u've faced any problems. I have done it using a App Server having Weblogic 8.1 whereas my comp has Weblogic 7.0 installed. My Remote Stateless Bean acting as a client could remotely access the Remote Entity Bean defined on the 8.1 App Server and execute the business methods on the same. Is this what you were looking for or is ur requirement different that what I had tried. Rgds, Seetesh
subject: Client Accessing EJBs from Different Physical App Servers