Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
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).]
<b>Sandeep</b> <br /> <br /><b>Sun Certified Programmer for Java 2 Platform</b><br /> <br /><b>Oracle Certified Solution Developer - JDeveloper</b><br /><b>-- Oracle JDeveloper Rel. 3.0 - Develop Database Applications with Java </b><br /><b>-- Object-Oriented Analysis and Design with UML</b><br /> <br /><b>Oracle Certified Enterprise Developer - Oracle Internet Platform</b><br /><b>-- Enterprise Connectivity with J2EE </b><br /><b>-- Enterprise Development on the Oracle Internet Platform </b>
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)
Weblogic 8.1 Custom Tag Reuse Protocol
Web Services for EJB Session Beans
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013