File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes comminication in EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "comminication in EJB" Watch "comminication in EJB" New topic

comminication in EJB

vasu chowdary
Ranch Hand

Joined: Mar 15, 2008
Posts: 90
Hi all,

I am new to EJB world,reading EJB in Action book to get the basic concepts. I understood that EJB is useful for writing reusable business compoents(pure business project) in any orgnization.To implement this i tried a HelloWorld example with below approach

1. Installed RAD with WAS7 for writing a EJB component in my local system
2.Installed JDK in my local system
3. BY pointing to WAS7 JDK, written below code and deployed to WAS7 successfully

Now i want to write a client application by pointing to Installed JDK, am i need to genrate any stubs for this?If so how can i genrate the stubs?
In webservices the interaction will be done in the form of XML's,so how the interaction will done from client to SessionBean in EJB?

ntumba lobo
Ranch Hand

Joined: Oct 21, 2008
Posts: 180
You are right with web service usually we have SOAP(xml) over HTTP, for EJBs it will simply be RMI the data being serialized.
To call your EJB the way you do it depends on the type of client.
But basically the idea is to do JNDI lookup to get a local proxy of your remote EJB.
In a server you can use dependency injection @Resource, outside a server you'll have to code manually the JNDI lookup.

I hope that'll help

I agree. Here's the link:
subject: comminication in EJB
It's not a secret anymore!