IntelliJ maven 无法打开项目
mattshma opened this issue · comments
mattshma commented
在以 maven 方式导入一个项目时,IntelliJ 一直卡在这里:
点击下一步无反应。以 gradle 方式能成功导入,猜测是 maven 问题,修改 “Enviroment settings” 中的 maven 的配置,无效。无奈查看 IntelliJ 的log(位于 /Users/xxx/Library/Logs/IntelliJIdea2016.3
),有如下报错:
Caused by: java.rmi.RemoteException: Cannot start maven service; nested exception is:
java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused
at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:173)
at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:78)
at org.jetbrains.idea.maven.server.RemoteObjectWrapper.getOrCreateWrappee(RemoteObjectWrapper.java:41)
at org.jetbrains.idea.maven.server.MavenServerManager$7.execute(MavenServerManager.java:558)
at org.jetbrains.idea.maven.server.MavenServerManager$7.execute(MavenServerManager.java:555)
at org.jetbrains.idea.maven.server.RemoteObjectWrapper.perform(RemoteObjectWrapper.java:76)
... 23 more
Caused by: java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:342)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at com.intellij.execution.rmi.RemoteProcessSupport.b(RemoteProcessSupport.java:257)
at com.intellij.execution.rmi.RemoteUtil.executeWithClassLoader(RemoteUtil.java:226)
at com.intellij.execution.rmi.RemoteProcessSupport.a(RemoteProcessSupport.java:255)
at com.intellij.execution.rmi.RemoteProcessSupport.acquire(RemoteProcessSupport.java:161)
at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:170)
... 28 more
网卡查了下,是 localhost 映射的问题,查看 /etc/hosts
:
127.0.0.1 localhost
::1 localhost
将 ::1 localhost
这行注释,再次导入项目,成功。