It's not a secret anymore!
The moose likes EJB and other Java EE Technologies and the fly likes EJB or Servlet 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 "EJB or Servlet" Watch "EJB or Servlet" New topic

EJB or Servlet

Manoj Gundawar
Ranch Hand

Joined: Nov 17, 2002
Posts: 169

I have to call EJB from standalone java application. EJB is developed in Websphere 5.1 J2EE 1.3 and is deployed on the server. (AIX Websphere, on remote machine)
When I call it from 'Client Application project' developed in WASAD, it works fine (with unacceptable response time). But when I try to run the same project from command prompt it dosent work, and gives lot of issues. (like IBM java vs Sun java etc)

So finally I decided to write servlet to serve the same purpose and call it from standalone application, instead of calling EJB.

My question is:
Is this a correct design? What are pros and cons?
Is there discussion on the comparision of these 2 approaches?

(I just dont want to do it cause I am not able to call EJB from standalone, but also want to know which way is better to do. )

Please provide your suggestion or reference.

Thanks in advance.

Sweet Turtle

Joined: Aug 23, 2004
Posts: 2
Hi Manoj,

Instead of writing servlet, u can use "launchClient" executable of WebSphere to invoke your application which calls EJB. This will work without the need for writing separate servlet.

Manoj Gundawar
Ranch Hand

Joined: Nov 17, 2002
Posts: 169
Thanks Sweet,
I know little about launchclient. I will read more about it and get back if have any queries. I have another question: Is there any portability issue with this kind of EJB client? We are planning to use this as local client on number of user's machines and we can not control their configuration (if they have IBM java or SUN java)
I agree. Here's the link:
subject: EJB or Servlet
jQuery in Action, 3rd edition