can not import project from maven(IDEA导入maven出错)

Posted ITBusTech

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了can not import project from maven(IDEA导入maven出错)相关的知识,希望对你有一定的参考价值。

在mac下使用idea来运行maven项目,如果你遇到的问题是下面列出的:

  • 导入项目时,始终无法进行下去,在等待一段时间后,界面总会回到上一个界面。

  • 对一个已存在的maven项目刷新依赖时,报 cannotimportprojectfrommaven

  • 在build项目是,idea界面下的进度条始终在 Readingpom.xml,进行一段时间后,提示失败。看idea日志是

 
   
   
 
  1. Caused by: java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:

  2.    java.net.ConnectException: Connection timed out

  3.    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)

  4.    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)

  5.    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)

  6.    at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)

  7.    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)

  8.    at com.intellij.execution.rmi.RemoteProcessSupport$2.compute(RemoteProcessSupport.java:215)

  9.    at com.intellij.execution.rmi.RemoteUtil.executeWithClassLoader(RemoteUtil.java:122)

  10.    at com.intellij.execution.rmi.RemoteProcessSupport.acquire(RemoteProcessSupport.java:212)

  11.    at com.intellij.execution.rmi.RemoteProcessSupport.acquire(RemoteProcessSupport.java:133)

  12.    at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:117)

  13.    ... 32 more

  14. Caused by: java.net.ConnectException: Connection timed out

  15.    at java.net.PlainSocketImpl.socketConnect(Native Method)

  16.    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)

  17.    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)

  18.    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)

  19.    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)

  20.    at java.net.Socket.connect(Socket.java:529)

  21.    at java.net.Socket.connect(Socket.java:478)

  22.    at java.net.Socket.(Socket.java:375)

  23.    at java.net.Socket.(Socket.java:189)

  24.    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)

  25.    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)

  26.    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)

  27.    ... 41 more

  28. 2012-10-03 11:58:01,752 [ 143250]  ERROR - com.intellij.ide.IdeEventQueue - IntelliJ IDEA 11.1.3  Build #IC-117.798

  29. 2012-10-03 11:58:01,752 [ 143250]  ERROR - com.intellij.ide.IdeEventQueue - JDK: 1.6.0_25

  30. 2012-10-03 11:58:01,752 [ 143250]  ERROR - com.intellij.ide.IdeEventQueue - VM: Java HotSpot(TM) 64-Bit Server VM

  31. 2012-10-03 11:58:01,752 [ 143250]  ERROR - com.intellij.ide.IdeEventQueue - Vendor: Sun Microsystems Inc.

  32. 2012-10-03 11:58:01,752 [ 143250]  ERROR - com.intellij.ide.IdeEventQueue - OS: Linux

  33. 2012-10-03 11:58:01,752 [ 143250]  ERROR - com.intellij.ide.IdeEventQueue - Last Action: OpenProject

  34. 2012-10-03 11:58:01,752 [ 143250]  ERROR - com.intellij.ide.IdeEventQueue - Original exception:  

  35. java.rmi.RemoteException: Cannot start maven service; nested exception is:

  36.    java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:

  37.    java.net.ConnectException: Connection timed out

  38.    at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:120)

  39.    at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:71)

  40.    at org.jetbrains.idea.maven.server.RemoteObjectWrapper.getOrCreateWrappee(RemoteObjectWrapper.java:41)

  41.    at org.jetbrains.idea.maven.server.MavenServerManager$8.execute(MavenServerManager.java:314)

  42.    at org.jetbrains.idea.maven.server.MavenServerManager$8.execute(MavenServerManager.java:311)

  43.    at org.jetbrains.idea.maven.server.RemoteObjectWrapper.perform(RemoteObjectWrapper.java:76)

  44.    at org.jetbrains.idea.maven.server.MavenServerManager.applyProfiles(MavenServerManager.java:311)

  45.    at org.jetbrains.idea.maven.project.MavenProjectReader.applyProfiles(MavenProjectReader.java:369)

  46.    at org.jetbrains.idea.maven.project.MavenProjectReader.doReadProjectModel(MavenProjectReader.java:98)

  47.    at org.jetbrains.idea.maven.project.MavenProjectReader.readProject(MavenProjectReader.java:52)

  48.    at org.jetbrains.idea.maven.project.MavenProject.read(MavenProject.java:405)

  49.    at org.jetbrains.idea.maven.project.MavenProjectsTree.doUpdate(MavenProjectsTree.java:534)

  50.    at org.jetbrains.idea.maven.project.MavenProjectsTree.doAdd(MavenProjectsTree.java:481)

  51.    at org.jetbrains.idea.maven.project.MavenProjectsTree.update(MavenProjectsTree.java:442)

  52.    at org.jetbrains.idea.maven.project.MavenProjectsTree.updateAll(MavenProjectsTree.java:413)

  53.    at org.jetbrains.idea.maven.wizards.MavenProjectBuilder.readMavenProjectTree(MavenProjectBuilder.java:198)

  54.    at org.jetbrains.idea.maven.wizards.MavenProjectBuilder.access$800(MavenProjectBuilder.java:44)

  55.    at org.jetbrains.idea.maven.wizards.MavenProjectBuilder$3.run(MavenProjectBuilder.java:179)

  56.    at org.jetbrains.idea.maven.utils.MavenUtil$8.run(MavenUtil.java:388)

  57.    at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:469)

  58.    at com.intellij.openapi.progress.impl.ProgressManagerImpl$6.run(ProgressManagerImpl.java:288)

  59.    at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178)

  60.    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:218)

  61.    at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:169)

  62.    at com.intellij.openapi.application.impl.ApplicationImpl$8$1.run(ApplicationImpl.java:641)

  63.    at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:434)

  64.    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

  65.    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

  66.    at java.util.concurrent.FutureTask.run(FutureTask.java:138)

  67.    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

  68.    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

  69.    at java.lang.Thread.run(Thread.java:662)

  70.    at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:145)

  71. Caused by: java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:

  72.    java.net.ConnectException: Connection timed out

  73.    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)

  74.    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)

  75.    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)

  76.    at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)

  77.    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)

  78.    at com.intellij.execution.rmi.RemoteProcessSupport$2.compute(RemoteProcessSupport.java:215)

  79.    at com.intellij.execution.rmi.RemoteUtil.executeWithClassLoader(RemoteUtil.java:122)

  80.    at com.intellij.execution.rmi.RemoteProcessSupport.acquire(RemoteProcessSupport.java:212)

  81.    at com.intellij.execution.rmi.RemoteProcessSupport.acquire(RemoteProcessSupport.java:133)

  82.    at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:117)

  83.    ... 32 more

  84. Caused by: java.net.ConnectException: Connection timed out

  85.    at java.net.PlainSocketImpl.socketConnect(Native Method)

  86.    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)

  87.    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)

  88.    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)

  89.    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)

  90.    at java.net.Socket.connect(Socket.java:529)

  91.    at java.net.Socket.connect(Socket.java:478)

  92.    at java.net.Socket.(Socket.java:375)

  93.    at java.net.Socket.(Socket.java:189)

  94.    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)

  95.    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)

  96.    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)

  97.    ... 41 more

那么恭喜你,这个坑我也踩过,你需要检查你的 /etc/hosts,看看 localhost是不是除了 127.0.0.1,是不是还指向其他ip了,没错这是idea的bug~

解决方法很简单,删除其他的 localhost的映射关系,只保留 127.0.0.1的这个就可以了~


以上是关于can not import project from maven(IDEA导入maven出错)的主要内容,如果未能解决你的问题,请参考以下文章

quasar打包时:Module not found: Can't resolve imported dependency "dayjs/plugin/customParseForm

can not implement the missing methods,either due to compile errors or the projects build path does(示

python类型错误:can only concatenate list (not "str") to list

PyTorch:The “freeze_support()” line can be omitted if the program is not going to be frozen

java.sql.SQLException: Can not issue data manipulation statements with execu 这是错误提示

首个WICKET HELLOL World 报错Can not determine Markup. Component is not yet connected to a parent.