FreeBSD Java, IPv6, and DNS SRV query type

Marcin Cieslak saper at system.pl
Thu Aug 28 13:47:21 UTC 2008


Benno Overeinder wrote:
> Hi,
> 
> Sometimes you just want it all: Java, IPv6, *and* DNS SRV query type
> requests.  Well, why?  We run an Openfire Jabber/XMPP server and want to
> run this service with IPv6 support.
> 
> So what is the situation.  With the Diablo Caffe/Latte package, IPv6
> support is not enabled.  (I don't know why, maybe someone can shed a
> light on this?)
> 
> To get Java with IPv6 support, we installed jdk15 (and later jdk16)
> using ports (java/jdk15 and java/jdk16).  During installation process we
> enabled IPv6 in the configuration.
> 
> 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:

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

--Marcin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 273 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-java/attachments/20080828/dba37189/signature.pgp


More information about the freebsd-java mailing list