From owner-freebsd-java@FreeBSD.ORG Sun Feb 23 15:25:45 2014 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BBB9BDCB; Sun, 23 Feb 2014 15:25:45 +0000 (UTC) Received: from mail.netplex.net (mail.netplex.net [204.213.176.9]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5B99B1659; Sun, 23 Feb 2014 15:25:44 +0000 (UTC) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.14.8/8.14.8/NETPLEX) with ESMTP id s1NFPhKW046631; Sun, 23 Feb 2014 10:25:43 -0500 X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.4.3 (mail.netplex.net [204.213.176.9]); Sun, 23 Feb 2014 10:25:43 -0500 (EST) Date: Sun, 23 Feb 2014 10:25:43 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Dan Daley Subject: Re: java.net.PlainDatagramSocketImpl.join(Native Method), invalid argument In-Reply-To: <43F3B96E-0BC7-4BEA-BAAF-CD43E69B1152@yahoo.com> Message-ID: References: <43F3B96E-0BC7-4BEA-BAAF-CD43E69B1152@yahoo.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Craig Rodrigues , freebsd-net@freebsd.org, jenkins-admin@freebsd.org, "freebsd-java@freebsd.org" X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Daniel Eischen List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 15:25:45 -0000 On Sun, 23 Feb 2014, Dan Daley wrote: > > I ran into this issue about a year and a half ago. If this is the > same issue, it had something to do with the way an IPv4 address is > bound to IPv6. I also ran into the issue on some older flavors of > linux, though it seems that the issue didn't happen on newer flavors. > > Sorry, I don't remember more details now. But, maybe someone else can > shed more light on the IPv4/IPv6 issue with UDP in Java. Sorry, I missed this thread. Craig, did you try forcing IPv4 by setting java.net.preferIPv4Stack=true? You can do it on the run line with -Djava.net.preferIPv4Stack=true or setting it in the code with System.setProperty ("java.net.preferIPv4Stack", "true"). I have to do this for our own applications that use multicast. I think the JRE recognizes that the OS has IPv6 enabled and tries to use that instead of IPv4. > > On Feb 22, 2014, at 10:45 PM, Craig Rodrigues wrote: > >> Hi, >> >> I can reproduce the following problem pretty easily >> on FreeBSD 9, 10, CURRENT. >> >> (1) Install the devel/jenkins port >> >> (2) Run: >> >> service jenkins onestart >> >> (3) In /var/log/jenkins.log, I see a traceback: >> >> WARNING: UDP handling problem >> java.net.SocketException: Invalid argument >> at java.net.PlainDatagramSocketImpl.join(Native Method) >> at >> java.net.AbstractPlainDatagramSocketImpl.join(AbstractPlainDatagramSocketImpl.java:168) >> at java.net.MulticastSocket.joinGroup(MulticastSocket.java:300) >> at hudson.UDPBroadcastThread.run(UDPBroadcastThread.java:76) >> Feb 22, 2014 5:21:00 PM hudson.WebAppMain$3 run >> >> >> >> I reported this bug against Jenkins: >> >> https://issues.jenkins-ci.org/browse/JENKINS-21727 >> >> >> but now I suspect that this is a FreeBSD bug or >> implementation with respect to multicast. >> >> >> Can someone help me debug this and isolate the problem? >> It's been a while since I've debugged Java code. >> >> Thanks. >> -- >> Craig -- DE