Hello,
can someone tell me how to call EJB from a java client application?
Thanks
-
How to use EJB from java client application? (4 messages)
- Posted by: yang yang
- Posted on: September 21 2001 04:35 EDT
Threaded Messages (4)
- How to use EJB from java client application? by regunath b on September 25 2001 08:38 EDT
- How to use EJB from java client application? by yang yang on September 26 2001 01:04 EDT
-
How to use EJB from java client application? by Mike D on October 01 2001 02:59 EDT
- How to use EJB from java client application? by Bijan Mohanty on October 01 2001 05:49 EDT
-
How to use EJB from java client application? by Mike D on October 01 2001 02:59 EDT
- How to use EJB from java client application? by yang yang on September 26 2001 01:04 EDT
-
How to use EJB from java client application?[ Go to top ]
- Posted by: regunath b
- Posted on: September 25 2001 08:38 EDT
- in response to yang yang
The easiest way is to provide a http gateway using a servlet that runs on the same app server as the EJBs and acts as the bridge between your client code(which I assume is a desktop application) and the EJBs. -
How to use EJB from java client application?[ Go to top ]
- Posted by: yang yang
- Posted on: September 26 2001 01:04 EDT
- in response to regunath b
thank you.
is this method the best one?
and do you have another method about it?
thanks.
-
How to use EJB from java client application?[ Go to top ]
- Posted by: Mike D
- Posted on: October 01 2001 14:59 EDT
- in response to yang yang
You can get a direct handle to the EJB from a application client. You just need to specify a few additional parameters in you InitialContext object. These are different for each app server. What server are you trying to talk with, maybe I have an example for you? Anyway, once you make the connection you do the lookup like normal, you have to narrow the returned object as it will be an RMI object that you get back, then you just use it like normal.
MikeD -
How to use EJB from java client application?[ Go to top ]
- Posted by: Bijan Mohanty
- Posted on: October 01 2001 17:49 EDT
- in response to Mike D
It actually depend upon the type of Java application you are using. If it's a web application in JSP etc, it's better
to talk to a gateway Servlet and let the servlet talk to the
EJB. Then Java app will talk to Servlet in HTTP mode and Servlet and EJB will talk in RMI. That will be beneficial in places with firewalls etc.
But if the Java application is nothing but a non-GUI applications, it's better to cut the servlet layer and talk directly to EJB by getting the Home from JNDI and creating the bean.
Hope this helps.