File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes classpath - error messages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "classpath - error messages" Watch "classpath - error messages" New topic

classpath - error messages

Tom Hutmacher

Joined: Aug 04, 2004
Posts: 3
Hello!I have here a book about ldap and java, which said that i have to download some files.
The files i'd downloaded by and now i have to copy them into the classpath, what i 'd done.
Classpath: jsdk../jre/lib/ext - files providerutil.jar + fscontext.jar.
Have I done this correctly?

by executing the java code i get those error messages:

javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.fscontext.FSContextFactory [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.fscontext.FSContextFactory]
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.(Unknown Source)
at Connect.main(
Caused by: java.lang.ClassNotFoundException: com.sun.jndi.fscontext.FSContextFactory
at$ Source)
at Method)
at Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)
... 5 more
Exception in thread "main"

--> i suppose the classpath could be the reason.

does somebody knows what to do?

thx a lot!
Seetesh Hindlekar
Ranch Hand

Joined: Feb 13, 2004
Posts: 244
The 2 files are basically required by Weblogic 5.1.

If using Weblogic 6.1 or higher no need to add these 2 files to classpath. Simply adding weblogic.jar will suffice.

Let me know if ur trying to access the LDAP server for accessing the Exchange Server for user related info, the code for importing the same and getting the user info is slightly different.


Tom Hutmacher

Joined: Aug 04, 2004
Posts: 3
Hi Seetesh!

I try to connect to a ldap directory...
for practise use I follwed the examples by my ldab book.

this is the code:

i also added the providerutil and fscontext to the classpath.

i don't think that I need the weblogic.jar...that would be verry confusing to me
Tom Hutmacher

Joined: Aug 04, 2004
Posts: 3
does nobody has an idea?
I agree. Here's the link:
subject: classpath - error messages
It's not a secret anymore!