Caused by: java.rmi.RemoteException: Cannot start maven service; nested exception is:
com.intellij.execution.ExecutionException:
导入一个maven项目一开始是idea日志没有报任何错误,突然有一天显示一条错误日志,打开日志内容大概如下(idea日志打开方式,菜单help–>show log in explorer–>记事本打开idea.log)
019-01-02 14:30:04,009 [12721895] 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:526)
at org.jetbrains.idea.maven.project.MavenProjectReader.applyProfiles(MavenProjectReader.java:394)
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:655)
at org.jetbrains.idea.maven.project.MavenProjectsTree.doUpdate(MavenProjectsTree.java:555)
at org.jetbrains.idea.maven.project.MavenProjectsTree.doAdd(MavenProjectsTree.java:500)
at org.jetbrains.idea.maven.project.MavenProjectsTree.update(MavenProjectsTree.java:461)
at org.jetbrains.idea.maven.project.MavenProjectsTree.update(MavenProjectsTree.java:443)
at org.jetbrains.idea.maven.project.MavenProjectsProcessorReadingTask.perform(MavenProjectsProcessorReadingTask.java:64)
at org.jetbrains.idea.maven.project.MavenProjectsProcessor.doProcessPendingTasks(MavenProjectsProcessor.java:132)
at org.jetbrains.idea.maven.project.MavenProjectsProcessor.access$000(MavenProjectsProcessor.java:32)
at org.jetbrains.idea.maven.project.MavenProjectsProcessor 2. r u n ( M a v e n P r o j e c t s P r o c e s s o r . j a v a : 107 ) a t o r g . j e t b r a i n s . i d e a . m a v e n . u t i l s . M a v e n U t i l . l a m b d a 2.run(MavenProjectsProcessor.java:107) at org.jetbrains.idea.maven.utils.MavenUtil.lambda 2.run(MavenProjectsProcessor.java:107)atorg.jetbrains.idea.maven.utils.MavenUtil.lambdarunInBackground$5(MavenUtil.java:449)
at com.intellij.openapi.application.impl.ApplicationImpl 1. r u n ( A p p l i c a t i o n I m p l . j a v a : 314 ) a t j a v a . u t i l . c o n c u r r e n t . E x e c u t o r s 1.run(ApplicationImpl.java:314) at java.util.concurrent.Executors 1.run(ApplicationImpl.java:314)atjava.util.concurrent.ExecutorsRunnableAdapter.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 W o r k e r . r u n ( T h r e a d P o o l E x e c u t o r . j a v a : 617 ) a t j a v a . l a n g . T h r e a d . r u n ( T h r e a d . j a v a : 745 ) C a u s e d b y : j a v a . r m i . R e m o t e E x c e p t i o n : C a n n o t s t a r t m a v e n s e r v i c e ; n e s t e d e x c e p t i o n i s : c o m . i n t e l l i j . e x e c u t i o n . E x e c u t i o n E x c e p t i o n : a t o r g . j e t b r a i n s . i d e a . m a v e n . s e r v e r . M a v e n S e r v e r M a n a g e r . c r e a t e ( M a v e n S e r v e r M a n a g e r . j a v a : 161 ) a t o r g . j e t b r a i n s . i d e a . m a v e n . s e r v e r . M a v e n S e r v e r M a n a g e r . c r e a t e ( M a v e n S e r v e r M a n a g e r . j a v a : 66 ) a t o r g . j e t b r a i n s . i d e a . m a v e n . s e r v e r . R e m o t e O b j e c t W r a p p e r . g e t O r C r e a t e W r a p p e e ( R e m o t e O b j e c t W r a p p e r . j a v a : 41 ) a t o r g . j e t b r a i n s . i d e a . m a v e n . s e r v e r . M a v e n S e r v e r M a n a g e r . l a m b d a 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: com.intellij.execution.ExecutionException: at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:161) at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:66) at org.jetbrains.idea.maven.server.RemoteObjectWrapper.getOrCreateWrappee(RemoteObjectWrapper.java:41) at org.jetbrains.idea.maven.server.MavenServerManager.lambda Worker.run(ThreadPoolExecutor.java:617)atjava.lang.Thread.run(Thread.java:745)Causedby:java.rmi.RemoteException:Cannotstartmavenservice;nestedexceptionis:com.intellij.execution.ExecutionException:atorg.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:161)atorg.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:66)atorg.jetbrains.idea.maven.server.RemoteObjectWrapper.getOrCreateWrappee(RemoteObjectWrapper.java:41)atorg.jetbrains.idea.maven.server.MavenServerManager.lambdaapplyProfiles$3(MavenServerManager.java:526)
at org.jetbrains.idea.maven.server.RemoteObjectWrapper.perform(RemoteObjectWrapper.java:76)
… 20 more
Caused by: com.intellij.execution.ExecutionException:
at com.intellij.execution.rmi.RemoteProcessSupport.acquire(RemoteProcessSupport.java:159)
at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:158)
… 24 more
很头疼,意思大概是maven项目无法远程连接,上网查了好多方法,都不管用,后来在maven设置那里vm options参数添加一行命令保存 -Didea.maven3.use.compat.resolver
这样就可以解决日志报错的问题啦!