Networking Release Notes
new URL ("http://www.foo.com:-1/index.html"). Specifying a port number of
-1is not valid. However, in previous releases the
-1was stripped off when sending such URLS with HTTP commands. In 1.4.2, the
-1is left in the URL and this may cause problems for some HTTP servers or proxies. Applications should not create URL instances with a
-1port number. Assuming the
-1refers to the default port in this example, the correct way to create this URL is
new URL ("http://www.foo.com/index.html"). This note only applies to the single argument URL constructor.
This has been corrected in 1.4 so that an IOException is thrown for any http error from the server and a specific exception of FileNotFoundExeption when the resource is not found (ie: 404 or 410 response codes). The exception is thrown irrespective of the file type.
Applications that assumed an exception would not be thrown when an http error is returned from the server need to be aware of this change in 1.4 - see 4160499.
Related to this issue is that HttpURLConnection.getErrorStream() method can now been used to read the error page from the http server when a http error is returned from the server. Previously getErrorStream() always returned null.
Applications that depend on toString() returning a string with the resolved hostname should be aware of this correction in 1.4 - see 4239141.
Applications that depend on behaviour where subsequent lookups always failed need to be aware of this issue - see 4256129. In addition the caching of negative lookups can be controlled by the networkaddress.cache.negative.ttl property in the java.security file.
The following lists the known issues with PortUnreachableException :-
If DHCP is used in conjunction with dynamic DNS then there are two options (i) change the name service search order in /etc/nsswitch.conf to use dns before the hosts file (ie: "hosts: dns files"), or (ii) configure InetAddress to use the DNS name service provider instead of the default provider (-Dsun.net.spi.nameservice.provider.1=dns,sun). This issue is being tracked in 4665037.
Copyright © 1993, 2011, Oracle and/or its affiliates. All rights reserved.