You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by se...@james.apache.org on 2004/07/06 23:59:54 UTC

[jira] Commented: (JAMES-302) Functionality of org.apache.james.dnsserver.DNSServer.getByName(String) is not symetric to java.net.InetAddress.getByName(String)

The following comment has been added to this issue:

     Author: Steve Brewin
    Created: Tue, 6 Jul 2004 2:59 PM
       Body:
Maybe stating the obvious, but in the code examples "localhost" is literal while "hostname" is symbolic. 

Replace "hostname" by a valid hostname within your local domain. For instance, a hostname of "james" should work within the local domain of "apache.org" just as well as the fully qualified name "james.apache.org".
---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/JAMES-302?page=comments#action_36531

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/JAMES-302

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: JAMES-302
    Summary: Functionality of org.apache.james.dnsserver.DNSServer.getByName(String) is not symetric to java.net.InetAddress.getByName(String)
       Type: Bug

     Status: Unassigned
   Priority: Critical

    Project: James
 Components: 
             DNSServer
   Versions:
             2.2.0

   Assignee: 
   Reporter: Steve Brewin

    Created: Tue, 6 Jul 2004 2:43 PM
    Updated: Tue, 6 Jul 2004 2:59 PM
Environment: Tested on WIN2000, JDK 1.4.1_01-b01

Description:
org.apache.james.dnsserver.DNSServer.getByName(String) does not always return the same result as java.net.InetAddress.getByName(address). Sometimes an exception is thrown when the standard implementation does not.

When passed a fully qualified domain name the results are the same. When passed a hostname or the special name 'localhost', a java.net.UnknownHostException is thrown by org.apache.james.dnsserver.DNSServer while java.net.InetAddress resolves the addresses correctly.

This is a critical issue as in v2.2.0 java.net.InetAddress.getByName() has pretty thoroughly been replaced by org.apache.james.dnsserver.DNSServer.getByName(), but in the noted circumstances it doesn't perform the same. Dependent code breaks.

Here are the contrasting examples...

// FAILS
String address = "localhost";
java.net.InetAddress inetAddress = org.apache.james.dnsserver.DNSServer.getByName(address);
return inetAddress;

// FAILS
String address = "hostname";
java.net.InetAddress inetAddress = org.apache.james.dnsserver.DNSServer.getByName(address);
return inetAddress;

// SUCCEEDS
String address = "localhost";
java.net.InetAddress inetAddress = java.net.InetAddress.getByName(address);
return inetAddress;

// SUCCEEDS
String address = "hostname";
java.net.InetAddress inetAddress = java.net.InetAddress.getByName(address);
return inetAddress;


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org