This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Access JNDI

 
prasad kulkarni
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How could I make a lookup to an JNDI located on remote machine. My ejb is deployed on a different maachine & web module is on another machine I want to make a looup for that EJB but not able to locate EJB. Is any sol^n?
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by prasad kulkarni:
How could I make a lookup to an JNDI located on remote machine. My ejb is deployed on a different maachine & web module is on another machine I want to make a looup for that EJB but not able to locate EJB. Is any sol^n?


What do you mean by could not locate EJB ? Are you getting exceptions ?
 
prasad kulkarni
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using webSphere & this is the code that I am trying :

Hashtable env = new Hashtable();
env.put(Context.PROVIDER_URL,"iiop://localhost:2809");
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");

But it is giving me exception of ClassNotFound : com.ibm.websphere.naming.WsnInitialContextFactory,

though I have included ns.jar in class path
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do a javap com.ibm.websphere.naming.WsnInitialContextFactory and make sure that the class is found.
 
Elid OR
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your war is deployed on webshere too ?
You said that ejb are deployed on a remote machine why do you use localhost in the urlprovider ?
 
prasad kulkarni
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remote machine means same machine with different JVM. The war is deployed in the websphere in same machine-different JVM.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
classpath is not typically used by application servers.

Have you tried including the ns.jar in your application's lib directory?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic