Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jndi hell !!

Ankur Jain
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just can't make it work.
i've added this code to

but now its giving these error messages
javax.naming.CommunicationException: Request: 1 cancelled
at com.sun.jndi.ldap.LdapRequest.getReplyBer(
at com.sun.jndi.ldap.Connection.readReply(
at com.sun.jndi.ldap.LdapClient.ldapBind(
at com.sun.jndi.ldap.LdapClient.authenticate(
at com.sun.jndi.ldap.LdapCtx.connect(
at com.sun.jndi.ldap.LdapCtx.<init>(
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(
at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(
at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(
at javax.naming.spi.NamingManager.getInitialContext(
at javax.naming.InitialContext.getDefaultInitCtx(
at javax.naming.InitialContext.init(
at javax.naming.InitialContext.<init>(
at AdviceClient.go(
at AdviceClient.main(

I'm using Sun App Server v8
my file looks like this :

Is the code for context.PROVIDER_URL field.(above) correct?
Please help me as I'm stuck with it for 4 days.
Alex Sharkoff
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Why are you using ldap to connect to the app server's naming context

I think this is the actual problem. You're using an overloaded InitialContext constructor (with Hashtable argument) and therefore, is never used (it gets used when no-arg InitialContext constructor is invoked).

You could still use an overloaded constructor of InitialContext provided that you populate Hashtable argument with the correct entries rather than with the ldap related ones

Hope it makes sense
[ June 16, 2004: Message edited by: Alex Sharkoff ]
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic