[Javaemailserver-user] DNS related exceptions thrown at startup
Brought to you by:
edaugherty,
mfg8876
|
From: <jav...@li...> - 2013-08-20 10:02:05
|
Hi all,
it has been plaguing JES at least since version 2.5. I am referring to the annoying exceptions being thrown when JES starts up. This is caused by the underlying JCE/JSSE implementation on two occasions.
1. The SecureRandom class sets up its seed generator:
sun.security.provider.SeedGenerator.getSystemEntropy(SeedGenerator.java:161
)
at
sun.security.provider.SecureRandom$SeederHolder.<clinit>(SecureRandom.java:
184)
at
sun.security.provider.SecureRandom.engineNextBytes(SecureRandom.java:203)
2. The SSLContext needs to retrieve a list of default cipher suites.
sun.security.ssl.SSLContextImpl.getDefaultCipherSuiteList(SSLContextImpl.ja
va:293)
at
sun.security.ssl.SSLServerSocketFactoryImpl.getDefaultCipherSuites(SSLServe
rSocketFactoryImpl.java:102)
Both these end up submitting a query to dnsjava for the host name of the PC that JES is being run from.
org.xbill.DNS.spi.DNSJavaNameService.lookupAllHostAddr(DNSJavaNameService.j
ava:147)
at
org.xbill.DNS.spi.DNSJavaNameService.invoke(DNSJavaNameService.java:97)
at com.sun.proxy.$Proxy0.lookupAllHostAddr(Unknown Source)
The erroneous console output is:
lookup myhost. A
NXDOMAIN
DNSJavaNameService: Unexpected error.
java.net.UnknownHostException: myhost
How to set about correcting this (and this mostly a matter of misconfiguration by the user and / or expectations regarding how professionally a machine is set up on behalf of oracle) ?
Obviously, the target here is to have dnsjava submit a query for an existing hostname. So, if your query entry is correct and actual DNS records exist (or can be delivered to your host), these exceptions will not be thrown.
This entry is the concatenation of the host name of the pc JES is being run from (let's call the host myhost) and the domain that the host belongs to (let's call the domain mydomain.com).
The FQDN query entry actually submitted by dnsjava would have to be "myhost.mydomain.com.".
How to construct this lookup query? I submit 3 alternatives and I am currently restricted to windows examples (linux does it very similarly).
Alternative 1: The host is indeed part of a Windows domain. Then change your computer name to "myhost" and make it a member of domain "mydomain.com".
Alternative 2: Change the computer name to "myhost.mydomain.com".
Alternative 3: Change the computer name to "myhost". Change the mail.bat arguments by setting dns.search to "mydomain.com".
(quotes were used for illustrative purposes. No warranty exists for misproper use of quotes in real-life situtations.)
The dns.server argument in mail.bat should be set to an IP of a resolver that can properly handle the queries. In simple cases this could be the IP of your home DSL/Router Gateway. It can even be left empty. You may have a bind server running on the host (then point dns.server to 127.0.0.1 or the Ipv6 equivalent). In more advanced cases (e.g. the nameserver of the local domain has its zones set up using the Split DNS principle) the IP may have to point to a resolver that can service IPs that belong to the internal view of the DNS namespace for the desired domain.
Confused?
It has to be understood that these issues do not affect JES operation. In fact, taking a careful look at the dnsjava output (you need to add -Ddns.options=verbose in mail.bat) you will notice that another query that takes place during startup most likely suceeds:
Sending to 127.0.0.1:53
queried javaemailserver.sourceforge.net. A
successful
This query is incidentaly triggered because JES has to retrieve a schema to validate mail.xml. In the end this DNS bug is nothing more than console garbage. When in doubt concerning DNS queries, use the lookup scripts in folder bin to test for the proper dnsjava settings (dns.server, dns.search arguments in mail.bat / mail.sh).
Regards,
Andreas
|