jorgemen / nb-ldap-explorer

Automatically exported from code.google.com/p/nb-ldap-explorer
0 stars 0 forks source link

getting UnknownHostException when trying to establish a connection (Active Directory) #10

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Created a new basic connection
2. Attempted "Establish New Connection" on the newly created connection

What is the expected output? What do you see instead?
Should expect to see LDAP browser.

What version of the product are you using? On what operating system?
LDAP Explorer 0.8
Product Version: NetBeans IDE 7.2 RC1 (Build 201206272359)
Java: 1.6.0_33; Java HotSpot(TM) 64-Bit Server VM 20.8-b03-424
System: Mac OS X version 10.7.4 running on x86_64; MacRoman; en_US (nb)
User directory: /Users/bryan/Library/Application Support/NetBeans/7.2rc1
Cache directory: /Users/bryan/Library/Caches/NetBeans/7.2rc1

Please provide any additional information below.

domain trying to bind to is dc=example,dc=local, example.local resolves to 
multiple IP addresses. server is myserver.example.com which does connect as I 
tried misspelling the servername and get the expected result that that server 
can not be found.

NOTE: There is no host at example.local, DNS resolves this to several Active 
Directory hosts.

Exception details as follows

java.net.UnknownHostException: example.local
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:195)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:385)
    at java.net.Socket.connect(Socket.java:529)
    at sun.reflect.GeneratedMethodAccessor104.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.sun.jndi.ldap.Connection.createSocket(Connection.java:338)
    at com.sun.jndi.ldap.Connection.<init>(Connection.java:186)
    at com.sun.jndi.ldap.LdapClient.<init>(LdapClient.java:116)
    at com.sun.jndi.ldap.LdapClient.getInstance(LdapClient.java:1580)
    at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2678)
    at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:296)
    at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:175)
    at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:134)
    at com.sun.jndi.url.ldap.ldapURLContextFactory.getObjectInstance(ldapURLContextFactory.java:35)
    at javax.naming.spi.NamingManager.getURLObject(NamingManager.java:584)
    at javax.naming.spi.NamingManager.processURL(NamingManager.java:364)
    at javax.naming.spi.NamingManager.processURLAddrs(NamingManager.java:344)
    at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:316)
    at com.sun.jndi.ldap.LdapReferralContext.<init>(LdapReferralContext.java:93)
Caused: javax.naming.CommunicationException: example.local:389 [Root exception 
is java.net.UnknownHostException: example.local]
    at com.sun.jndi.ldap.LdapReferralContext.<init>(LdapReferralContext.java:74)
    at com.sun.jndi.ldap.LdapReferralException.getReferralContext(LdapReferralException.java:132)
    at com.sun.jndi.ldap.LdapNamingEnumeration.hasMoreReferrals(LdapNamingEnumeration.java:339)
    at com.sun.jndi.ldap.LdapNamingEnumeration.hasMoreImpl(LdapNamingEnumeration.java:208)
Caused: javax.naming.PartialResultException [Root exception is 
javax.naming.CommunicationException: johnsands.local:389 [Root exception is 
java.net.UnknownHostException: example.local]]
    at com.sun.jndi.ldap.LdapNamingEnumeration.hasMoreImpl(LdapNamingEnumeration.java:224)
    at com.sun.jndi.ldap.LdapNamingEnumeration.hasMore(LdapNamingEnumeration.java:171)
    at dk.i2m.netbeans.modules.ldapexplorer.model.BaseLdapServer.getTree(BaseLdapServer.java:637)
Caused: dk.i2m.netbeans.modules.ldapexplorer.model.QueryException
    at dk.i2m.netbeans.modules.ldapexplorer.model.BaseLdapServer.getTree(BaseLdapServer.java:672)
    at dk.i2m.netbeans.modules.ldapexplorer.model.BaseLdapServer.getTree(BaseLdapServer.java:529)
    at dk.i2m.netbeans.modules.ldapexplorer.model.LdapServer.access$201(LdapServer.java:41)
    at dk.i2m.netbeans.modules.ldapexplorer.model.LdapServer.getTree(LdapServer.java:172)
[catch] at 
dk.i2m.netbeans.modules.ldapexplorer.model.LdapEntryChildren$1.run(LdapEntryChil
dren.java:62)
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1452)
    at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2032)

Original issue reported on code.google.com by brett.r...@gmail.com on 3 Aug 2012 at 11:47

GoogleCodeExporter commented 8 years ago
Thanks for your report. The stack trace indeed suggests problems with the dns. 
You should be aware of a potential conflict between you choosen domain name 
(local) and the zeroconf/bonjour local domain (used for multicast DNS: 
http://en.wikipedia.org/wiki/Multicast_DNS). This could lead to problems - if 
you can I would move of this domain name.

If your wondering, that you specified myserver.example.com as the host name for 
the server and got an error reporting example.local then this is what happens: 
The server you specified is queried, the server returns the infos it can and 
potentially referrels. These referrels are pointers to other server, that hold 
more information with regard to your query. In this case this was example.local.

To work around this problem you can try to access the global catalog, which is 
a searchable read-only copy of the whole directory: See 
http://technet.microsoft.com/en-us/library/cc728188%28v=ws.10%29.aspx.

If I find the time, I'll try to make the handling of referrels configurable but 
that is a different bug (closing this one). If you still think this is a bug, 
feel free to reopen this bug and state what would be your expectation with 
regard to the gui if errors like these occur?

Original comment by matthiasblaesing1@googlemail.com on 10 Aug 2012 at 7:18

GoogleCodeExporter commented 8 years ago
Thanks Mat, I have forwarded this response to our infrastructure team though I 
do not anticipate anything happening.

All hosts on our network are given host.example.com.au but join to the network 
domain of example.local, I don't know why they set it up this way though I 
suspect it's so that example.com.au still resolves to the external public IP 
web address.

What I do find peculiar however is that if I use tomcat to provide a realm 
provider (org.apache.catalina.realm.JNDIRealm) using the exact same 
configuration it works as expected. Also other Java based systems in our 
environment also work without problems (namely confluence and JIRA).

Original comment by brett.r...@gmail.com on 11 Aug 2012 at 1:33