• 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

Basic JNDI problem

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Folks,

I have just started practising JNDI but facing some basic problem.
Just wanted to play with directory and files in my system to get understanding of JNDI.

I have written following CODE
__________________________________________________________________
javax.naming.Context c = new javax.naming.InitialContext(System.getProperties());
Object o = c.lookup("c:\");

_______________________________________________________________

if i simply run my class after removing "Object o = c.lookup("c:\").
it gives same error , i am posting my error below.
ERROR:
_________________________________________________________________
ERROR! Shared library ioser12 could not be found.
javax.naming.NamingException: Error accessing repository: Cannot connect to ORB
at com.sun.enterprise.naming.EJBCtx.<init>(EJBCtx.java:51)
at com.sun.enterprise.naming.EJBInitialContextFactory.getInitialContext(EJBInitialContextFactory.java:62)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init>(InitialContext.java:195)
at jndi.TestJndi.main(TestJndi.java:18)
_____________________________________________________________________
before posting the message I have searched the previous post but could not able to find anything useful.
If anybody have idea. do let me know.
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Two things i can see namely:

1. Does this code compile??? It should be "C:\\" and not "C:\" on windows.

2. Next you are using System.getProperties() to initialize your InitialContext, have you set the environment properties appropriately. You need to mention the class who is going to be the provider of the JNDI.

Hope this helps
 
reply
    Bookmark Topic Watch Topic
  • New Topic