File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
EJB and other Java EE Technologies
calling a EJB from JSP in weblogic , please help me fast
Joined: May 14, 2001
May 26, 2001 04:32:00
I want to call an
(which is deployed) from a
page in weblogic , can any one please give an detailed steps for, how to do this.
thanks in advance
Joined: Apr 02, 2001
May 26, 2001 08:37:00
The steps for calling EJB deployed in
would be as follows.
[list]Set up the environmental properties
specific to your container
Hashtable env = new Hashtable(); //Refer to the documentation of your AS for setting the env. env.put(Context.SECURITY_PRINCIPAL,"name");
using the environmental settings.
Context ctx = new InitialContext(env);
[/list][list]Get the reference (factory) of your HomeObject
//"url" would be specific to AS.It depends on how your AS publishes the HomeObject.For instance Oracle iAS, it is "sess_iiop://sandeep:1521 [img]http://www.javaranch.com/ubb/redface.gif[/img]racle8i/MyHome".Refer to your AS documentation for details. MyHome home = (MyHome) ctx.lookup("url");
[/list][list]Use the HomeObject factory to create the EJB Object
MyEJBObject obj = home.create();
[/list][list]Call any of your business methods using the
obj.doSomething(); //finally remove the reference. obj.remove();
Also, note that most like BEA would be using RMI-IIOP protocol.In that case,Step 3 might change to :
MyHome home = (MyHome)javax.rmi.PortableRemoteObject.narrow(ctx.lookup("url"),MyHome.class);
Hope this helps,
[This message has been edited by Desai Sandeep (edited May 26, 2001).]
I agree. Here's the link:
subject: calling a EJB from JSP in weblogic , please help me fast
Assertion failed (Socket closed and FD realsed)
Web Services for EJB Session Beans
Weblogic 8.1 Custom Tag Reuse Protocol
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015