• Post Reply Bookmark Topic Watch Topic
  • New Topic

JNDI  RSS feed

 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I keep getting this Exception

Exception Caught: javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.fscontext.RefFSContextFactory [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.fscontext.RefFSContextFactory]

Which means "the classpath for the JNDI program does not contain the JNDI server classes:"

I don't understand what they mean by "JNDI server classes".

I had included j2ee.jar from J2EE RI in classpath.

I followed this tutorial
http://www.developer.com/java/ent/article.php/10933_2215571_4.

Kindly help me with this.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This page makes it sound as if the file system context implementation that you are trying to use is not part of the JNDI that comes with J2SE/J2EE. Follow the "Download JNDI 1.2.1 & More" link to get to a page where you can download it separately.
[ January 04, 2006: Message edited by: Ulf Dittmer ]
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the link and the explanation Ulf Dittmer. That was really helpful.

I got one doubt with the classpath for fscontext.jar file.

I had never included

C:\jdk\lib\tools.jar;
C:\jdk\jre\lib\rt.jar;

These two jar in my classpath. JRE just picks them up.

As per the instruction in the link which you gave me I downloaded the fscontext.zip file and placed fscontext.jar and providerutil.jar in

C:\jdk\jre\lib\ext folder.

Why JRE is NOT picking these jar files?
Only after including these jar files in my classpath, the program is executing with out the previously stated error.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!