From owner-freebsd-amd64@FreeBSD.ORG Sat Nov 12 02:23:06 2005 Return-Path: X-Original-To: freebsd-amd64@freebsd.org Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1855E16A41F; Sat, 12 Nov 2005 02:23:06 +0000 (GMT) (envelope-from rschi@rsmba.biz) Received: from admin.cablespeed.com (admin.cablespeed.com [216.15.205.79]) by mx1.FreeBSD.org (Postfix) with ESMTP id A42E243D45; Sat, 12 Nov 2005 02:23:05 +0000 (GMT) (envelope-from rschi@rsmba.biz) Received: from [66.235.9.146] (account schilling@cablespeed.com HELO [192.168.2.2]) by admin.cablespeed.com (CommuniGate Pro SMTP 4.2.10) with ESMTP id 60886490; Fri, 11 Nov 2005 20:23:05 -0600 Message-ID: <437552C9.90603@rsmba.biz> Date: Fri, 11 Nov 2005 18:26:17 -0800 From: Richard Schilling Organization: Richard Schilling, MBA User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.5) Gecko/20050318 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Sean McNeil References: <43753947.3040108@rsmba.biz> <1131756005.6959.12.camel@triton.mcneil.com> In-Reply-To: <1131756005.6959.12.camel@triton.mcneil.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-amd64@freebsd.org, freebsd-java@freebsd.org Subject: Re: BindAddress exception error (was BindAddress error with jdk1.5 and Tomcat and Resin) X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2005 02:23:06 -0000 This was the fix. Thanks' Sean. (I'll honor the free web hosting BTW) Here's what I did. I added the following line to /etc/rc.conf: jakarta_tomcat55_java_opts="-Djava.net.preferIPv4Stack=true" JDK1.5 chokes on binding to any address with FreeBSD 6.0 because of the IPv6 stack. The JDK documentation on IPv6 documents this command line define, also. On a related note, when I tried to build JDK1.5 with IPV6 support, I got an error. But, that's a subject for another thread, I think. Thanks Sean. Richard Sean McNeil wrote: > On Fri, 2005-11-11 at 16:37 -0800, Richard Schilling wrote: > >>I'm narrowing down a problem with BindAddress on jdk1.5, FreeBSD RELENG_6 . >> >>uname -a output: >>FreeBSD newbox.cognitiongroup.biz 6.0-STABLE FreeBSD 6.0-STABLE #3: Fri >>Nov 4 23:36:56 PST 2005 >>rschilling@cognitiongroup.biz:/usr/obj/usr/src/sys/PRODUCTION amd64 >> >>Here's the error: >> >>$ java TestServer localhost 8080 >>Host Address=localhost >>Port =8080 >>Exception in thread "main" java.net.BindException: Can't assign >>requested address >> at java.net.PlainSocketImpl.socketBind(Native Method) >> at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359) >> at java.net.ServerSocket.bind(ServerSocket.java:319) >> at java.net.ServerSocket.bind(ServerSocket.java:277) >> at TestServer.main(TestServer.java:15) > > > What does > > netstat -a | grep 8080 > > show you? > > Have you tried starting it with > > java.net.preferIPv4Stack=true > > set? > > Cheers, > Sean > > > > >