users@glassfish.java.net

Re: FreeBSD glassfish

From: Homer Yau <Homer.Yau_at_Sun.COM>
Date: Fri, 10 Nov 2006 10:54:37 -0800

Hi,

I will agree to what Kenneth said. "never assume"

I did assume is config issue on the appserver side at the first time,
but it turns out is the system setup issue (networking issue - loopback
is not setup correctly).

Never assume all system work/config the same way. A lesson well learn.

Thanks,
Homer

Kenneth Clark wrote:

> Just an update
>
> an edit on /etc/rc.conf revealed that ifconfig_lo0 = dhcp (what the
> point of that is is beyond me)
>
> it also revealed it wasn't bringing up the lo0 device at boot.
>
> editing and saving the file resolved the issue of initializing the
> interface and starting the domain.
>
> Kenneth Clark wrote:
>
>> And that my dear friends is how you debug.
>>
>> Thanks very much for the input (feel like a bit of a moron for
>> assuming the loop back device was fine)
>>
>> after running ifconfig lo0 127.0.0.1 up and starting the domain it
>> runs fine.
>>
>> Thanks for all your patience and we will file this under "learning
>> curve"
>>
>> Lessons learnt?
>>
>> ping localhost would have established that the loopback wasn't
>> working. So start from the plug and make sure what ever is not
>> working is first plugged in and never assume your loopback device is
>> working :D
>>
>> Thanks again
>>
>> Binod wrote:
>>
>>> Kenneth Clark wrote:
>>>
>>>> Hi
>>>>
>>>> Sorry I didn't get back to you sooner.
>>>>
>>>> Here is the resulting output from the last snippet (which looks
>>>> strangely familiar to the problem I am having)
>>>
>>>
>>> It is the same problem, just that we got it reproduced outside the
>>> appserver
>>> (so, not an appserver issue).
>>>
>>>>
>>>> Ok, We got the loopback address
>>>> Exception in thread "main" java.net.BindException: Can't assign
>>>> requested address
>>>
>>>
>>> This basically mean that lo0 is not configured properly or not
>>> available.
>>>
>>> Try ifconfig -a (Hope it is the same in FreeBSD) and see lo0 is up
>>> or not...
>>>
>>> Perhaps you need to do "ifconfig lo0 127.0.0.1 up"
>>>
>>> - Binod.
>>>
>>>> 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.<init>(ServerSocket.java:185)
>>>> at tt.main(tt.java:16)
>>>>
>>>>
>>>>
>>>> Binod wrote:
>>>>
>>>>> Kenneth Clark wrote:
>>>>>
>>>>>> I have attached the files, if this is not sufficient let me know
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Lets see, if we need more :-)
>>>>>
>>>>> Can we try this small java app? Look like there is some problem
>>>>> with loopback address.
>>>>>
>>>>> import java.net.*;
>>>>> import java.nio.channels.*;
>>>>>
>>>>> public class t {
>>>>> public static void main(String[] args) throws Exception {
>>>>>
>>>>> InetAddress address = InetAddress.getByName(null);
>>>>>
>>>>> if (address.isLoopbackAddress()) {
>>>>> System.out.println("Ok, We got the loopback address");
>>>>> } else {
>>>>> System.out.println("Oh! getByName(null) returns
>>>>> non-loop back address");
>>>>> address = null;
>>>>> }
>>>>>
>>>>> ServerSocket s1 = new ServerSocket(0,0,address);
>>>>>
>>>>> System.out.println("s1 is:" + s1.getLocalPort());
>>>>>
>>>>> }
>>>>>
>>>>> }
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>>>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>>>>
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>