Intellij - Cannot start maven service - ExecutionException

Simon B picture Simon B · Nov 5, 2014 · Viewed 9.2k times · Source

I'm using Intellij 13.1.5 on Ubuntu 14.0.4 (amd64), Maven 3.0.5, Java Oracle 1.7.0_72

I noticed some irregularities with maven whilst using Intellij namely dependencies added and removed where not reflected in the module or in the External Libaries listing.

Then when I ran Intellij from the shell I saw this exception:

[  14649]   WARN -      #org.jetbrains.idea.maven - Cannot open index /home/sbotting/.IntelliJIdea13/system/Maven/Indices/Index0 
org.jetbrains.idea.maven.indices.MavenIndexException: Cannot open index /home/sbotting/.IntelliJIdea13/system/Maven/Indices/Index0
   at org.jetbrains.idea.maven.indices.MavenIndex.open(MavenIndex.java:164)
   at org.jetbrains.idea.maven.indices.MavenIndex.<init>(MavenIndex.java:139)
   at org.jetbrains.idea.maven.indices.MavenIndices.load(MavenIndices.java:59)
   at org.jetbrains.idea.maven.indices.MavenIndices.<init>(MavenIndices.java:47)
   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$2.run(MergingUpdateQueue.java:254)
   at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269)
   at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227)
   at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217)
   at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
   at com.intellij.util.Alarm$Request$1.run(Alarm.java:327)
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
   at java.util.concurrent.FutureTask.run(FutureTask.java:262)
   at com.intellij.util.concurrency.QueueProcessor$RunnableConsumer.consume(QueueProcessor.java:298)
   at com.intellij.util.concurrency.QueueProcessor$RunnableConsumer.consume(QueueProcessor.java:295)
   at com.intellij.util.concurrency.QueueProcessor$2$1.run(QueueProcessor.java:110)
   at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
   at com.intellij.util.concurrency.QueueProcessor$2.consume(QueueProcessor.java:107)
   at com.intellij.util.concurrency.QueueProcessor$2.consume(QueueProcessor.java:104)
   at com.intellij.util.concurrency.QueueProcessor$3$1.run(QueueProcessor.java:215)
   at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
   at com.intellij.util.concurrency.QueueProcessor$3.run(QueueProcessor.java:212)
   at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:419)
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
   at java.util.concurrent.FutureTask.run(FutureTask.java:262)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
   at java.lang.Thread.run(Thread.java:745)
   at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:149)
Caused by: 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:305)
   at org.jetbrains.idea.maven.indices.MavenIndex.access$500(MavenIndex.java:40)
   at org.jetbrains.idea.maven.indices.MavenIndex$IndexData.<init>(MavenIndex.java:611)
   at org.jetbrains.idea.maven.indices.MavenIndex.doOpen(MavenIndex.java:185)
   at org.jetbrains.idea.maven.indices.MavenIndex.open(MavenIndex.java:161)
   ... 33 more
Caused by: java.rmi.RemoteException: Cannot start maven service; nested exception is: 
   com.intellij.execution.ExecutionException:     -Xmixed           mixed mode execution (default)
   -Xint             interpreted mode execution only
   -Xbootclasspath:<directories and zip/jar files separated by :>
                     set search path for bootstrap classes and resources
   -Xbootclasspath/a:<directories and zip/jar files separated by :>
                     append to end of bootstrap class path
   -Xbootclasspath/p:<directories and zip/jar files separated by :>
                     prepend in front of bootstrap class path
   -Xdiag            show additional diagnostic messages
   -Xnoclassgc       disable class garbage collection
   -Xincgc           enable incremental garbage collection
   -Xloggc:<file>    log GC status to a file with time stamps
   -Xbatch           disable background compilation
   -Xms<size>        set initial Java heap size
   -Xmx<size>        set maximum Java heap size
   -Xss<size>        set java thread stack size
   -Xprof            output cpu profiling data
   -Xfuture          enable strictest checks, anticipating future default
   -Xrs              reduce use of OS signals by Java/VM (see documentation)
   -Xcheck:jni       perform additional checks for JNI functions
   -Xshare:off       do not attempt to use shared class data
   -Xshare:auto      use shared class data if possible (default)
   -Xshare:on        require using shared class data, otherwise fail.
   -XshowSettings    show all settings and continue
   -XshowSettings:all
                     show all settings and continue
   -XshowSettings:vm show all vm related settings and continue
   -XshowSettings:properties
                     show all property settings and continue
   -XshowSettings:locale
                     show all locale related settings and continue
The -X options are non-standard and subject to change without notice
   at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:124)
   at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:65)
   at org.jetbrains.idea.maven.server.RemoteObjectWrapper.getOrCreateWrappee(RemoteObjectWrapper.java:41)
   at org.jetbrains.idea.maven.server.MavenServerManager$5.create(MavenServerManager.java:387)
   at org.jetbrains.idea.maven.server.MavenServerManager$5.create(MavenServerManager.java:383)
   at org.jetbrains.idea.maven.server.RemoteObjectWrapper.getOrCreateWrappee(RemoteObjectWrapper.java:41)
   at org.jetbrains.idea.maven.server.MavenIndexerWrapper.getRemoteId(MavenIndexerWrapper.java:159)
   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)
   ... 39 more
Caused by: com.intellij.execution.ExecutionException:     -Xmixed           mixed mode execution (default)
   -Xint             interpreted mode execution only
   -Xbootclasspath:<directories and zip/jar files separated by :>
                     set search path for bootstrap classes and resources
   -Xbootclasspath/a:<directories and zip/jar files separated by :>
                     append to end of bootstrap class path
   -Xbootclasspath/p:<directories and zip/jar files separated by :>
                     prepend in front of bootstrap class path
   -Xdiag            show additional diagnostic messages
   -Xnoclassgc       disable class garbage collection
   -Xincgc           enable incremental garbage collection
   -Xloggc:<file>    log GC status to a file with time stamps
   -Xbatch           disable background compilation
   -Xms<size>        set initial Java heap size
   -Xmx<size>        set maximum Java heap size
   -Xss<size>        set java thread stack size
   -Xprof            output cpu profiling data
   -Xfuture          enable strictest checks, anticipating future default
   -Xrs              reduce use of OS signals by Java/VM (see documentation)
   -Xcheck:jni       perform additional checks for JNI functions
   -Xshare:off       do not attempt to use shared class data
   -Xshare:auto      use shared class data if possible (default)
   -Xshare:on        require using shared class data, otherwise fail.
   -XshowSettings    show all settings and continue
   -XshowSettings:all
                     show all settings and continue
   -XshowSettings:vm show all vm related settings and continue
   -XshowSettings:properties
                     show all property settings and continue
   -XshowSettings:locale
                     show all locale related settings and continue
The -X options are non-standard and subject to change without notice.
   at com.intellij.execution.rmi.RemoteProcessSupport.acquire(RemoteProcessSupport.java:142)
   at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:121)
   ... 48 more

I've tried deleting the ~/.IntelliJIdea13/system/Maven/ with no result

My M2_HOME is properly set to /usr/share/maven

I assume that the solution lies in finding the underlying cause for the ExecutionException although the diagnostic doesn't really help with this.

I've tried reverting back to Intellij 12.0.4 and it works fine (in terms of Maven - although sadly it doesn't support svn 1.8)

also the output seems to come from the java -X command which gives you a printout of all the -X options

Any suggestions?

Answer

ashic picture ashic · Aug 23, 2016

I had this problem all of a sudden (after an update + Windows Update). I tried a lot of things, and in the end, set Settings > Build, Execution, Deployment > Build Tools > Maven > Importing > JDK for Importer to Use JAVA_HOME (which I've set up as an env var pointing to a JDK install). That seems to work.