IDEA Unable to import maven project 解决方法

最近在用maven无论是新建项目还是导入没有下载到本地仓库的jar。出现了Unable to import maven project 

该错误。而且每次idea要卡顿很长时间。大概3-5分钟吧。由于本人的本本是mac ,系统用了两年多了,虽然中间有一些更新包打了。但一直都比较稳定。而且由于之前要测试网络,结果把localhost指向了192.168.0.101  结果悲剧就出现了。后来查看了日志,发现了有


2017-04-13 23:31:18,792 [2109473]  ERROR -      #org.jetbrains.idea.maven - Cannot reconnect. 
java.lang.RuntimeException: Cannot reconnect.
at org.jetbrains.idea.maven.server.RemoteObjectWrapper.perform(RemoteObjectWrapper.java:82)
at org.jetbrains.idea.maven.server.MavenServerManager.applyProfiles(MavenServerManager.java:555)
at org.jetbrains.idea.maven.project.MavenProjectReader.applyProfiles(MavenProjectReader.java:397)
at org.jetbrains.idea.maven.project.MavenProjectReader.doReadProjectModel(MavenProjectReader.java:103)
at org.jetbrains.idea.maven.project.MavenProjectReader.readProject(MavenProjectReader.java:62)
at org.jetbrains.idea.maven.project.MavenProject.read(MavenProject.java:631)
at org.jetbrains.idea.maven.project.MavenProjectsTree.doUpdate(MavenProjectsTree.java:560)
at org.jetbrains.idea.maven.project.MavenProjectsTree.doAdd(MavenProjectsTree.java:505)
at org.jetbrains.idea.maven.project.MavenProjectsTree.update(MavenProjectsTree.java:466)
at org.jetbrains.idea.maven.project.MavenProjectsTree.update(MavenProjectsTree.java:448)
at org.jetbrains.idea.maven.project.MavenProjectsProcessorReadingTask.perform(MavenProjectsProcessorReadingTask.java:64)
at org.jetbrains.idea.maven.project.MavenProjectsProcessor.doProcessPendingTasks(MavenProjectsProcessor.java:130)
at org.jetbrains.idea.maven.project.MavenProjectsProcessor.access$000(MavenProjectsProcessor.java:30)
at org.jetbrains.idea.maven.project.MavenProjectsProcessor$2.run(MavenProjectsProcessor.java:105)
at org.jetbrains.idea.maven.utils.MavenUtil.lambda$runInBackground$5(MavenUtil.java:458)
at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:309)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
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: Operation timed out
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)
... 20 more
Caused by: java.rmi.ConnectException: Connection refused to host: localhost; nested exception is: 
java.net.ConnectException: Operation timed out
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.a(RemoteProcessSupport.java:258)
at com.intellij.execution.rmi.RemoteUtil.executeWithClassLoader(RemoteUtil.java:226)
at com.intellij.execution.rmi.RemoteProcessSupport.b(RemoteProcessSupport.java:256)
at com.intellij.execution.rmi.RemoteProcessSupport.acquire(RemoteProcessSupport.java:162)
at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:170)
... 25 more
Caused by: java.net.ConnectException: Operation timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at java.net.Socket.(Socket.java:434)
at java.net.Socket.(Socket.java:211)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:148)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
... 34 more


类似的异常信息,就去ping localhost 结果发现指向的是192.168.0.101,看了我自己的IP,发现根本就不在一个网段。。因为一个IP的问题折腾了好久。。哎,还得多看日志,多看日志,多看日志。。引以为戒




你可能感兴趣的:(IDE)