When I do a LookUp from a Session bean, Is it necessary to provide factory and provider information to get the initial context? Can someone help me and if possible provide a CODE snippet please.
Thanks and eagerly looking for help.
-
Lookup Help (3 messages)
- Posted by: Anand Kumar
- Posted on: March 23 2001 18:04 EST
Threaded Messages (3)
- Lookup Help by kiran killedar on March 24 2001 06:28 EST
- Lookup Help by Anand Kumar on March 24 2001 20:57 EST
- Lookup Help by Somil Nanda on March 26 2001 05:13 EST
- Lookup Help by Anand Kumar on March 24 2001 20:57 EST
-
Lookup Help[ Go to top ]
- Posted by: kiran killedar
- Posted on: March 24 2001 06:28 EST
- in response to Anand Kumar
hi ,
which application server r u using that is important.
If u r using j2ee server then use
Properties p=new Properties(System.getProperties());
home = (ProductHome) ctx.lookup("ProductHome");
or else
if u r using weblogic 6.0 then use this
Properties p=new Properties();
p.putContext.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.TengahInitialContextFactory");
p.put(Context.PROVIDER_URL,"t3://10.100.100.119:7001");
Context ctx = new InitialContext(p);
home = (ProductHome) ctx.lookup("ProductHome");
i hope this should work for u
bye
-kiran -
Lookup Help[ Go to top ]
- Posted by: Anand Kumar
- Posted on: March 24 2001 20:57 EST
- in response to kiran killedar
Thanks for the information.
But I am still not clear about this question:
When I do a LookUp from a Session bean, Is it necessary to provide factory and provider information to get the initial context?
I was refering in respect to WebSphere.
Please reply,
-
Lookup Help[ Go to top ]
- Posted by: Somil Nanda
- Posted on: March 26 2001 17:13 EST
- in response to Anand Kumar
No its is not neccessary to provide factory and provider information to get the initial context when doing a lookup from session bean or for that matter any serverside code
u can do this
Context ctx = getInitialContext();