voodoodyne / subethasmtp

SubEtha SMTP is a Java library for receiving SMTP mail
Other
343 stars 138 forks source link

Hostname resolution causes issues with Graal #90

Open tofflos opened 5 years ago

tofflos commented 5 years ago

The current way of resolving the hostname uses a static initializer under the hood which leads to problems when building a native binary using Graal.

try
{
    this.hostName = InetAddress.getLocalHost().getCanonicalHostName();
}
catch (UnknownHostException e)
{
    this.hostName = UNKNOWN_HOSTNAME;
}

The static initializer within InetAddress is executed at build time on the build system. This causes a crash later on at runtime on the executing system where the results of said initialization isn't available.

davidmoten commented 5 years ago

See #84, you may wish to raise the issue on an active fork of this project (I'd suggest mine for the moment).