• 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

NoClassDefFoundError!!!!LDAP hell

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I'm writing application to connect to server and retrieve employee information(I haven't even got to that part), i try to connect by doing:-
Hashtable environment = new Hashtable();
environment.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
environment.put(Context.PROVIDER_URL,"ldap://172.27.24.3:389");
try
{
InitialDirContext root = new InitialDirContext(environment); //exception is thrown here
MessageBox.show("Connection Successful");
}
catch(NamingException ex)
{
MessageBox.show("Sorry Connection Unsuccessful"+"Error: "+ ex);
}
so I went into debug mode and i got the stack for it and I checked, and I don't know what's wrong with.....did i not give correct permissions for LDAP, since i link the libraries by reference rather than installing the jar files??anyways this is the stack(the relevant part anyway):-
java.lang.NoClassDefFoundError
at java/lang/Class.forName (Class.java)
at com/sun/naming/internal/VersionHelper11.loadClass (VersionHelper11.java:49)
at javax/naming/spi/NamingManager.getInitialContext (NamingManager.java:660)
at javax/naming/InitialContext.getDefaultInitCtx (InitialContext.java:250)
at javax/naming/InitialContext.init (InitialContext.java:221)
at javax/naming/InitialContext.<init> (InitialContext.java:198)
at javax/naming/directory/InitialDirContext.<init> (InitialDirContext.java:86)
at Query.btnGo_click (Query.java:220)
Thanks in advance, if somebody could help me, i would be most grateful.
Best Regards,
Sim
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic