Maven import fails with error Unable to import Maven project. idea.log has the exception:
2020-02-28 11:26:44,513  WARN - ution.rmi.RemoteProcessSupport - java.rmi.NotBoundException: _DEAD_HAND_
2020-02-28 11:26:44,514  WARN - ution.rmi.RemoteProcessSupport - at java.rmi/sun.rmi.registry.RegistryImpl.lookup(RegistryImpl.java:234)
2020-02-28 11:26:44,514  WARN - ution.rmi.RemoteProcessSupport - at com.intellij.execution.rmi.RemoteServer.start(RemoteServer.java:93)
2020-02-28 11:26:44,514  WARN - ution.rmi.RemoteProcessSupport - at org.jetbrains.idea.maven.server.RemoteMavenServer36.main(RemoteMavenServer36.java:23)
2020-02-28 11:26:44,864  WARN - ution.rmi.RemoteProcessSupport - The cook failed to start due to java.io.EOFException
2020-02-28 11:26:44,864  ERROR - #org.jetbrains.idea.maven - Cannot reconnect.
java.lang.RuntimeException: Cannot reconnect.
Caused by: java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
java.net.ConnectException: Connection refused (Connection refused)
IDE launches Maven import in a separate java process and communicates with it using java RMI calls which work via local loopback interface (localhost). To access the loopback interface the localhost hostname is used. When IDE is unable to establish connection to a localhost this error occurs. There could be several causes why localhost is not accessible:
The 127.0.0.1 is the standard address for IPv4 loopback traffic and the localhost name must resolve to 127.0.0.1 IPv4 address. If it is not - the error will occur.
- Antivirus or firewall blocks connections to localhost
- Make sure the localhost hostname resolves to 127.0.0.1 IPv4 loopback address. It is better to leave only localhost name for the 127.0.0.1 address. For this the hosts file must have only following lines for mapping localhost to IPv4 and IPv6 local addresses:
It is better to remove other mappings for 127.0.0.1 ip address and localhost name.
- Make sure the antivirus or firewall are configured to allow localhost connections and IDE is allowed to make connections on the system.
For example there is a known issue with ESET network protection that blocks localhost. The workaround is to configure ESET to allow localhost connections:
>The issue should be resolved in next service release.
>Work around is to creating a rule to allow the localhost connections.