File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Attemplting to connect to a public LDAP directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Attemplting to connect to a public LDAP directory" Watch "Attemplting to connect to a public LDAP directory" New topic
Author

Attemplting to connect to a public LDAP directory

K Aditi
Ranch Hand

Joined: Mar 17, 2008
Posts: 89
Hi,
I am trying to retrieve digital certificates from VeriSign public LDAP directory. Sometime back I had posted a question on in the Security forum.Here is the link.
I hope this is the right place to post my continuing question.
Now that I have managed to find the host url(at least I believe I have!), I am attempting to bind to VeriSign's directory using JNDI. Following is the code,


I am getting the following exception:

Exception in thread "main" javax.naming.CommunicationException: directory.verisign.com:389 [Root exception is java.net.NoRouteToHostException: No route to host: connect]
at com.sun.jndi.ldap.Connection.<init>(Connection.java:204)
at com.sun.jndi.ldap.LdapClient.<init>(LdapClient.java:118)
at com.sun.jndi.ldap.LdapClient.getInstance(LdapClient.java:1578)
at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2596)
at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:283)
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:175)
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:193)
at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:136)
at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:66)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.<init>(InitialContext.java:197)
at javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:82)
at LDAPConnect.setInitialContext(LDAPConnect.java:70)
at LDAPConnect.main(LDAPConnect.java:92)
Caused by: java.net.NoRouteToHostException: No route to host: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:364)
at java.net.Socket.connect(Socket.java:507)
at java.net.Socket.connect(Socket.java:457)
at java.net.Socket.<init>(Socket.java:365)
at java.net.Socket.<init>(Socket.java:178)
at com.sun.jndi.ldap.Connection.createSocket(Connection.java:346)
at com.sun.jndi.ldap.Connection.<init>(Connection.java:181)
... 15 more


Is this a firewall issue?being a beginner in LDAP.
Cant figure out what's wrong
Thanks,


Aditi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Attemplting to connect to a public LDAP directory
 
Similar Threads
Connection To Active Directory Error
Unable to create a JNDI InitialContext problem
LDAP server Access Error in java
cannot connect to LDAP through JNDI
WebSphere 4.0.x and JNDI Timeout