Intellij Ultimate 2016.2在项目导入后停留在maven构建上

时间:2016-12-27 11:02:58

标签: java maven intellij-idea

在Intellij中导入maven项目后。它开始了索引和构建的后台任务。构建任务没有完成。我检查了Intellij日志,发现了一个Runtime异常。

仅在Intellij后台任务中发生这种情况。

    #org.jetbrains.idea.maven - Cannot reconnect. 
    java.lang.RuntimeException: Cannot reconnect.
        at org.jetbrains.idea.maven.server.RemoteObjectWrapper.perform(RemoteObjectWrapper.java:111)
        at org.jetbrains.idea.maven.server.MavenIndexerWrapper.createIndex(MavenIndexerWrapper.java:61)
        at org.jetbrains.idea.maven.indices.MavenIndex.createContext(MavenIndex.java:359)
        at org.jetbrains.idea.maven.indices.MavenIndex.access$600(MavenIndex.java:48)
        at org.jetbrains.idea.maven.indices.MavenIndex$IndexData.<init>(MavenIndex.java:661)
        at org.jetbrains.idea.maven.indices.MavenIndex.doOpen(MavenIndex.java:203)
        at org.jetbrains.idea.maven.indices.MavenIndex.open(MavenIndex.java:172)
        at org.jetbrains.idea.maven.indices.MavenIndex.<init>(MavenIndex.java:148)
        at org.jetbrains.idea.maven.indices.MavenIndices.load(MavenIndices.java:58)
        at org.jetbrains.idea.maven.indices.MavenIndices.<init>(MavenIndices.java:46)
        at org.jetbrains.idea.maven.indices.MavenIndicesManager.ensureInitialized(MavenIndicesManager.java:107)
        at org.jetbrains.idea.maven.indices.MavenIndicesManager.getIndicesObject(MavenIndicesManager.java:91)
        at org.jetbrains.idea.maven.indices.MavenIndicesManager.ensureIndicesExist(MavenIndicesManager.java:164)
        at org.jetbrains.idea.maven.indices.MavenProjectIndicesManager$3.run(MavenProjectIndicesManager.java:120)
        at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)
        at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)
        at com.intellij.util.ui.update.MergingUpdateQueue.lambda$flush$1(MergingUpdateQueue.java:260)
        at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:274)
        at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:229)
        at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:222)
        at com.intellij.util.Alarm$Request$1.run(Alarm.java:378)
        at com.intellij.util.Alarm$Request.run(Alarm.java:389)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:227)
        at com.intellij.util.concurrency.BoundedTaskExecutor.runFirstTaskThenPollAndRunRest(BoundedTaskExecutor.java:178)
        at com.intellij.util.concurrency.BoundedTaskExecutor.access$000(BoundedTaskExecutor.java:40)
        at com.intellij.util.concurrency.BoundedTaskExecutor$2.run(BoundedTaskExecutor.java:197)
        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:168)
        at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:73)
        at org.jetbrains.idea.maven.server.RemoteObjectWrapper.getOrCreateWrappee(RemoteObjectWrapper.java:41)
        at org.jetbrains.idea.maven.server.MavenServerManager$4.create(MavenServerManager.java:487)
        at org.jetbrains.idea.maven.server.MavenServerManager$4.create(MavenServerManager.java:483)
        at org.jetbrains.idea.maven.server.RemoteObjectWrapper.getOrCreateWrappee(RemoteObjectWrapper.java:41)
        at org.jetbrains.idea.maven.server.MavenIndexerWrapper.getRemoteId(MavenIndexerWrapper.java:169)
        at org.jetbrains.idea.maven.server.MavenIndexerWrapper.access$100(MavenIndexerWrapper.java:37)
        at org.jetbrains.idea.maven.server.MavenIndexerWrapper$1.execute(MavenIndexerWrapper.java:64)
        at org.jetbrains.idea.maven.server.RemoteObjectWrapper.perform(RemoteObjectWrapper.java:105)
        ... 30 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.b(RemoteProcessSupport.java:258)
        at com.intellij.execution.rmi.RemoteUtil.executeWithClassLoader(RemoteUtil.java:226)
        at com.intellij.execution.rmi.RemoteProcessSupport.a(RemoteProcessSupport.java:256)
        at com.intellij.execution.rmi.RemoteProcessSupport.acquire(RemoteProcessSupport.java:162)
        at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:165)
        ... 39 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.<init>(Socket.java:434)
        at java.net.Socket.<init>(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)

如何解决此问题?

2 个答案:

答案 0 :(得分:0)

猜猜看。你在localhost上配置了代理吗?似乎IDEA试图连接到你的localhost。

答案 1 :(得分:0)

这是Intellij远程服务器管理器的问题。编辑/ etc / hosts并确保只存在一个指向localhost的条目。

127.0.0.1   localhost 

希望如果有人遇到同样的问题,答案会有所帮助。