• 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

Access JNDI

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do a javap com.ibm.websphere.naming.WsnInitialContextFactory and make sure that the class is found.
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
reply
    Bookmark Topic Watch Topic
  • New Topic