It seems that you will need to write some native code to do this:

class Inet4AddressImpl implements InetAddressImpl {
    public native String getLocalHostName() throws UnknownHostException;

On Thu, Aug 12, 2010 at 10:44 AM, Afkham Azeez <[email protected]> wrote:

> This is because "localhost" has been hard coded
> in CarbonInet4AddressImpl#getLocalHostName
> and CarbonInet6AddressImpl#getLocalHostName, to avoid the unnecessary
> delays. If you could fix it to get the proper name it will be great. This
> has not been an issue so far, but it can cause problems in certain cases.
>
> See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4939977
>
>
> Thanks
> Azeez
>
> On Thu, Aug 12, 2010 at 10:06 AM, Kasun Indrasiri <[email protected]> wrote:
>
>> Hi all,
>>
>> We have faced an issue in ESB, where we cannot get the actual host name of
>> the machine which ESB runs on.
>> The host name is retrieved using InetAddress as follows.
>>
>> InetAddress addr = InetAddress.getLocalHost();
>> hostName = addr.getHostName(); // (this is always 'localhost' and not
>> equal to machine's 'bash$ hostname' value)
>>
>> I had a discussion with Azzez regarding this, and the workaround is to
>> remove the following entries from wso2server.sh.  (InetAddress has a bug,
>> which leads to 5 sec delay in env where there is no reverse DNS enabled.
>> This configuration is used to address that)
>>
>> -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
>> -Dimpl.prefix=Carbon \
>>
>> AFAIK, this issue is common to all the products. Are we going to fix this
>> in our future releases?
>>
>>
>> Thanks.
>>
>> --
>> Kasun Indrasiri
>> Senior Software Engineer
>> WSO2, Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>> cell: +94 71 536 4128
>> Blog : http://kasunpanorama.blogspot.com/
>>
>> _______________________________________________
>> Carbon-dev mailing list
>> [email protected]
>> https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>>
>>
>
>
> --
> Afkham Azeez
> Senior Software Architect & Senior Manager; WSO2, Inc.; http://wso2.com,
> Lean . Enterprise . Middleware
> Member; Apache Software Foundation; http://www.apache.org/
> email: [email protected] cell: +94 77 3320919
> blog: http://blog.afkham.org
> twitter: http://twitter.com/afkham_azeez
> linked-in: http://lk.linkedin.com/in/afkhamazeez
>



-- 
Afkham Azeez
Senior Software Architect & Senior Manager; WSO2, Inc.; http://wso2.com,
Lean . Enterprise . Middleware
Member; Apache Software Foundation; http://www.apache.org/
email: [email protected] cell: +94 77 3320919
blog: http://blog.afkham.org
twitter: http://twitter.com/afkham_azeez
linked-in: http://lk.linkedin.com/in/afkhamazeez
_______________________________________________
Carbon-dev mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev

Reply via email to