Skip to main content

IZ77432: UNKNOWNHOSTEXCEPTION IN GETLOCALHOST()


Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Error Message: N/A
    .
    Stack Trace: java.net.UnknownHostException: localhost: localhost
    at java.net.InetAddress.getAllByName0(InetAddress.java:1249)
    at java.net.InetAddress.getAllByName(InetAddress.java:1176)
    at java.net.InetAddress.getAllByName(InetAddress.java:1099)
    at java.net.InetAddress.getByName(InetAddress.java:1049)
    at HostName.main(HostName.java:6)
    .
    

Local fix

  • Use IPv4 instead of IPv6 as default. Pass
    -Djava.net.preferIPv4Stack=true as a command line parameter to
    the JVM to resolve the issue
    

Problem summary

  • getByName() and getLocalHost() returns an unexpected
    java.net.UnknownHostException when /etc/services file is
    empty/corrupted in Java 5
    

Problem conclusion

  • This defect will be fixed in:
    5.0.0 SR12
    .
    The unwanted services parameter "domain" in getaddrinfo() has
    been changed
    .
    To obtain the fix:
    Install build 20100625 or later
    

Temporary fix

  • -Djava.net.preferIPv4Stack=true
    (Enable IPv4 by default and everything works fine)
    

Comments

APAR Information

  • APAR number

    IZ77432

  • Reported component name

    JAVA 5 CLASS LI

  • Reported component ID

    620500130

  • Reported release

    500

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2010-06-16

  • Closed date

    2010-06-25

  • Last modified date

    2010-07-22

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    JAVA 5 CLASS LI

  • Fixed component ID

    620500130

Applicable component levels

  • R500 PSN

       UP

Rate this page:

(0 users)Average rating

Copyright and trademark information

IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.

Rate this page:


(0 users)Average rating

Add comments

Document information

Runtimes for Java Technology

Java Class Libraries


Software version:
5.0


Reference #:
IZ77432


Modified date:
2010-07-22

Translate my page

Content navigation