FreeBSD Java, IPv6, and DNS SRV query type
Benno Overeinder
benno at NLnetLabs.nl
Mon Sep 1 10:17:52 UTC 2008
Hi,
Thanks for your reply.
Marcin Cieslak wrote:
> Benno Overeinder wrote:
>> <snip/>
>>
>> All set and go, and IPv6 worked with our Java programs, including the
>> Openfire server.
>>
>> However, DNS SRV _xmpp-server._tcp.domain.name resolution fails with the
>> ports java/jdk16 build. (Consequently, only Jabber servers that are
>> running on hosts known by their DNS domain name are found.) For
>> example, contacts with a Google Talk account are not found.
>
> I don't know what's wrong with your code (it gives me the same results)
> but I tried a small jython program:
Just for clarification, you also compiled and installed jdk16 (ports
package java/jdk16)? And the test program also fails to resolve the DNS
SRV request _xmpp-server._tcp.google.com? The test program is more or
less the isolated code from the Openfire XMPP server.
Hmmm, I wonder why there are not more messages mentioning this problem
with Java on FreeBSD.
> import java
> from javax.naming import Context
> from javax.naming.directory import InitialDirContext
>
> env = java.util.Hashtable()
> env.put(Context.INITIAL_CONTEXT_FACTORY,
> "com.sun.jndi.dns.DnsContextFactory")
> ictx = InitialDirContext(env)
> print ictx.getAttributes("_xmpp-server._tcp.google.com", ["SRV"])
>
> the result:
>
> {srv=SRV: 20 0 5269 xmpp-server3.l.google.com., 20 0 5269
> xmpp-server4.l.google.com., 5 0 5269 xmpp-server.l.google.com., 20 0
> 5269 xmpp-server1.l.google.com., 20 0 5269 xmpp-server2.l.google.com.}
>
> The funny part begins when I enter IPv6 DNS server address
> (I run one on my LAN) in /etc/resolv.conf (say, "2001:DB8::1"). But this
> is a known bug:
>
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5042453
Thanks.
But the Java code does run successfully on Linux or Solaris with IPv6
enabled.
Cheers,
-- Benno
--
Benno J. Overeinder
NLnet Labs
http://www.nlnetlabs.nl/
More information about the freebsd-java
mailing list