Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within EJB and other Jakarta /Java EE Technologies
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
EJB and other Jakarta /Java EE Technologies
calling a EJB from JSP in weblogic , please help me fast
santosh vashist
Greenhorn
Posts: 25
posted 22 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi all
I want to call an
EJB
(which is deployed) from a
JSP
page in weblogic , can any one please give an detailed steps for, how to do this.
thanks in advance
sans
Desai Sandeep
Ranch Hand
Posts: 1157
posted 22 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Santosh,
The steps for calling EJB deployed in
any AS
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");
[/list][list]Create a InitialContext 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 EJBObject reference.
obj.doSomething(); //finally remove the reference. obj.remove();
[/list]
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,
Sandeep
[This message has been edited by Desai Sandeep (edited May 26, 2001).]
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Assertion failed (Socket closed and FD realsed)
servlets
Web Services for EJB Session Beans
Tuning JSP
Weblogic 8.1 Custom Tag Reuse Protocol
More...