• 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 ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Jndi - can't find

Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to locate the initial context factory, and I am receiving the error: ClassNotFound for com.sun.jndi.fscontext.RefFSContextFactory.
I have reinstalled SDK1.4 the most current version of Java. I cannot seem to locate the jndi files on my system. I have performed a scan for jndi and I found nothing. Does anyone have any suggestions?
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import java.util.*;
import javax.naming.*;
import javax.naming.directory.*;
public class jndiTest {
static String name;
public static void main(String args[]) {
if (args.length > 0) name = args[0];
Hashtable env = new Hashtable();
"com.sun.jndi.fscontext.RefFSContextFactory" );
try {
// Create the initial context
Context ctx = new InitialContext(env);
// Look up an object
Object obj = ctx.lookup(name);
// Print it
System.out.println(name + " is bound to: " + obj);

} catch (NamingException e) {
System.err.println("Problem looking up " + name + ": " + e);
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check your installation to see if fscontext.jar is anywhere in your CLASSPATH. I don't believe it comes bundled with J2SE1.4 even though the JNDI package is bundled.
    Bookmark Topic Watch Topic
  • New Topic