• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

JNDI lookup problem from SessionBean

 
Author
Posts: 531
Mac OS X Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi friends
I use WSAD 5.1.2 and test environment 5.
I have a problem in locating a CMP from a
Session bean (Stateless) .
There is one package in my project named cmps
and two ejb
1-SessionBean : Usermanagement.
2-CMP : User.
I used UTC to check my CMP it works fine and has no problem
but my lookup code in SessionBean could not find it in JNDI

my code is :
public UserLocalHome getUserHome()throws NamingException
{
Context ctx = new InitialContext();
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
env.put(Context.PROVIDER_URL,"corbaloc::127.0.0.1:9810");
return (UserLocalHome)ctx.lookup("ejb/cmps/UserLocalHome");
}
Also I tried to use local lookup (previus code without env) but it doesnt works.

can some one tell me what is problem here?
thank you.
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well,

shouldnt you first create the Hashtable (env) with the proper values and then create the InitialContext passing the env?
How would the InitialCOntext know about the properties otherwise?

check the port number for the RMI connector, too (just an idea)


cheers
Joe
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic