Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Searching with JNDI  RSS feed

 
Med Shabe
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can run a simple program in a simple editor that does a simle search with JNDI. However, when the same program is run under VisualAge for Java I get the following error:
javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.ldap.LdapCtxFactory
I have included the j2ee.jar in the classpath.
Appreciate any thoughts.
[ February 21, 2002: Message edited by: Med Shabe ]
 
Pavel Drobnych
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no 'LdapCtxFactory' in j2ee.jar:
...
bash$ jar tvf j2ee.jar | grep com.sun.jndi.LdapCtxFactory | wc -l
0
...
You need to include provider's original jar. Like 'org.jnp.interfaces.NamingContextFactory' in 'jnpserver.jar' of JBoss :roll:
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!