del
del

Reputation: 6561

Unable to import Maven project into IntelliJ IDEA

I'm having problems importing any Maven projects into IntelliJ IDEA. I create an empty Maven project like this:

$ mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

Then I try to open the project in IDEA (File > Open Project, then choose the pom.xml). A progress box saying "Reading pom.xml" displays for a few minutes, and then just disappears without opening the project.

Looking in the IDEA log, I see some connection timeout exceptions like this:

2012-10-03 11:55:38,502 [      0]   INFO -        #com.intellij.idea.Main - ------------------------------------------------------ IDE STARTED ------------------------------------------------------ 
2012-10-03 11:55:38,512 [     10]   INFO -        #com.intellij.idea.Main - IDE: IntelliJ IDEA (build #IC-117.798, 25 Jul 2012 00:00) 
2012-10-03 11:55:38,512 [     10]   INFO -        #com.intellij.idea.Main - JRE: 1.6.0_25-b06 (Sun Microsystems Inc.) 
2012-10-03 11:55:38,512 [     10]   INFO -        #com.intellij.idea.Main - JVM: 20.0-b11 (Sun Microsystems Inc.) 
2012-10-03 11:55:38,539 [     37]   INFO - .intellij.idea.IdeaApplication - WM detected: Compiz 
2012-10-03 11:55:40,328 [   1826]   INFO - llij.ide.plugins.PluginManager - 28 plugins initialized in 1613 ms 
2012-10-03 11:55:40,328 [   1826]   INFO - llij.ide.plugins.PluginManager - Loaded plugins:IDEA CORE, Properties Support, Ant Support (1.0), XPathView + XSLT Support (4), IntelliLang (8.0), Copyright (8.1), Groovy (9.0), Maven Integration, Scala (0.5.981), Git Integration (8.1), Task Management (1.0), GitHub, hg4idea (10.0), CVS Integration (11), Intention Power Pack (1.0), I18n for Java, TestNG-J (8.0), GenerateToString (5.0), Commander (1.0.0), Plugin DevKit (1.0), UI Designer, Gradle, Eclipse Integration (3.0), Inspection Gadgets (1.0), JUnit (1.0), Subversion Integration (1.1), XSLT-Debugger (1.4), Android Support (10.0) 
2012-10-03 11:55:40,755 [   2253]   INFO - ellij.util.io.PagedFileStorage - lower=100; upper=200; buffer=10; mmap=true 
2012-10-03 11:55:40,799 [   2297]   INFO - api.vfs.impl.local.FileWatcher - Starting file watcher: /usr/lib/idea-IC-117.798/bin/fsnotifier64 
2012-10-03 11:55:40,800 [   2298]   INFO - api.vfs.impl.local.FileWatcher - Native file watcher is operational. 
2012-10-03 11:55:41,181 [   2679]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $APP_CONFIG$/ui.lnf.xml file is null 
2012-10-03 11:55:41,181 [   2679]   INFO - .impl.stores.XmlElementStorage - Document was not loaded for $APP_CONFIG$/ui.lnf.xml 
2012-10-03 11:55:41,824 [   3322]   INFO -                  TestNG Runner - Create TestNG Template Configuration 
2012-10-03 11:55:41,833 [   3331]   INFO -                  TestNG Runner - Create TestNG Template Configuration 
2012-10-03 11:55:41,935 [   3433]   INFO - ellij.project.impl.ProjectImpl - 23 project components initialized in 693 ms 
2012-10-03 11:55:41,936 [   3434]   INFO - .module.impl.ModuleManagerImpl - 0 modules loaded in 0 ms 
2012-10-03 11:55:41,948 [   3446]   INFO - .intellij.ide.XmlRpcServerImpl - XmlRpc server listening at /127.0.0.1:63342 
2012-10-03 11:55:42,252 [   3750]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $APP_CONFIG$/macros.xml file is null 
2012-10-03 11:55:42,252 [   3750]   INFO - .impl.stores.XmlElementStorage - Document was not loaded for $APP_CONFIG$/macros.xml 
2012-10-03 11:55:42,256 [   3754]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $APP_CONFIG$/quicklists.xml file is null 
2012-10-03 11:55:42,256 [   3754]   INFO - .impl.stores.XmlElementStorage - Document was not loaded for $APP_CONFIG$/quicklists.xml 
2012-10-03 11:55:42,330 [   3828]   INFO - pl.stores.ApplicationStoreImpl - 79 application components initialized in 1910 ms 
2012-10-03 11:55:42,345 [   3843]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $APP_CONFIG$/customization.xml file is null 
2012-10-03 11:55:42,345 [   3843]   INFO - .impl.stores.XmlElementStorage - Document was not loaded for $APP_CONFIG$/customization.xml 
2012-10-03 11:55:42,499 [   3997]   INFO - ij.openapi.wm.impl.IdeRootPane - App initialization took 4825 ms 
2012-10-03 11:55:50,842 [  12340]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $APP_CONFIG$/plainTextFiles.xml file is null 
2012-10-03 11:55:50,842 [  12340]   INFO - .impl.stores.XmlElementStorage - Document was not loaded for $APP_CONFIG$/plainTextFiles.xml 
2012-10-03 11:55:55,348 [  16846]   INFO - ution.rmi.RemoteProcessSupport - /usr/lib/jvm/jdk1.6.0_25/jre/bin/java -Djava.awt.headless=true -Xmx512m -Dfile.encoding=UTF-8 -classpath /usr/lib/idea-IC-117.798/lib/resources_en.jar:/usr/lib/idea-IC-117.798/lib/annotations.jar:/usr/lib/idea-IC-117.798/lib/util.jar:/usr/lib/idea-IC-117.798/lib/trove4j.jar:/usr/lib/idea-IC-117.798/lib/jdom.jar:/usr/lib/idea-IC-117.798/plugins/maven/lib/lucene-core-2.4.1.jar:/usr/lib/idea-IC-117.798/plugins/maven/lib/activation-1.1.jar:/usr/lib/idea-IC-117.798/plugins/maven/lib/maven-2.2.1-uber.jar:/usr/lib/idea-IC-117.798/plugins/maven/lib/maven2-server-impl.jar:/usr/lib/idea-IC-117.798/plugins/maven/lib/jaxb-impl.jar:/usr/lib/idea-IC-117.798/plugins/maven/lib/jaxb-api.jar:/usr/lib/idea-IC-117.798/plugins/maven/lib/maven-embedder-1.1-SNAPSHOT.jar:/usr/lib/idea-IC-117.798/plugins/maven/lib/classworlds-1.1.jar:/usr/lib/idea-IC-117.798/plugins/maven/lib/resources_en.jar:/usr/lib/idea-IC-117.798/plugins/maven/lib/commons-beanutils.jar:/usr/lib/idea-IC-117.798/plugins/maven/lib/mercury-artifact-1.0-alpha-6.jar:/usr/lib/idea-IC-117.798/plugins/maven/lib/maven-server-api.jar:/usr/lib/idea-IC-117.798/plugins/maven/lib/maven-dependency-tree-1.2.jar:/usr/lib/idea-IC-117.798/plugins/maven/lib/archetype-common-2.0-alpha-4-SNAPSHOT.jar:/usr/lib/idea-IC-117.798/plugins/maven/lib/plexus-utils-1.5.5.jar:/usr/lib/idea-IC-117.798/plugins/maven/lib/wadl-core.jar:/usr/lib/idea-IC-117.798/plugins/maven/lib/nexus-indexer-1.2.3.jar org.jetbrains.idea.maven.server.RemoteMavenServer 
2012-10-03 11:55:55,483 [  16981]   INFO - ution.rmi.RemoteProcessSupport - Port/ID: 18011/Maven2ServerImpl9407569f 
2012-10-03 11:56:58,898 [  80396]   WARN - ution.rmi.RemoteProcessSupport - The cook failed to start due to java.net.ConnectException: Connection timed out 
2012-10-03 11:57:55,483 [ 136981]   WARN - ution.rmi.RemoteProcessSupport - java.rmi.NotBoundException: _DEAD_HAND_ 
2012-10-03 11:57:55,484 [ 136982]   WARN - ution.rmi.RemoteProcessSupport - at sun.rmi.registry.RegistryImpl.lookup(RegistryImpl.java:106) 
2012-10-03 11:57:55,484 [ 136982]   WARN - ution.rmi.RemoteProcessSupport - at com.intellij.execution.rmi.RemoteServer.start(RemoteServer.java:73) 
2012-10-03 11:57:55,484 [ 136982]   WARN - ution.rmi.RemoteProcessSupport - at org.jetbrains.idea.maven.server.RemoteMavenServer.main(RemoteMavenServer.java:22) 
2012-10-03 11:58:01,749 [ 143247]  ERROR - com.intellij.ide.IdeEventQueue - Error during dispatching of java.awt.event.MouseEvent[MOUSE_RELEASED,(65,116),absolute(64,140),button=1,modifiers=Button1,clickCount=1] on frame0 
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:311)
    at org.jetbrains.idea.maven.project.MavenProjectReader.applyProfiles(MavenProjectReader.java:369)
    at org.jetbrains.idea.maven.project.MavenProjectReader.doReadProjectModel(MavenProjectReader.java:98)
    at org.jetbrains.idea.maven.project.MavenProjectReader.readProject(MavenProjectReader.java:52)
    at org.jetbrains.idea.maven.project.MavenProject.read(MavenProject.java:405)
    at org.jetbrains.idea.maven.project.MavenProjectsTree.doUpdate(MavenProjectsTree.java:534)
    at org.jetbrains.idea.maven.project.MavenProjectsTree.doAdd(MavenProjectsTree.java:481)
    at org.jetbrains.idea.maven.project.MavenProjectsTree.update(MavenProjectsTree.java:442)
    at org.jetbrains.idea.maven.project.MavenProjectsTree.updateAll(MavenProjectsTree.java:413)
    at org.jetbrains.idea.maven.wizards.MavenProjectBuilder.readMavenProjectTree(MavenProjectBuilder.java:198)
    at org.jetbrains.idea.maven.wizards.MavenProjectBuilder.access$800(MavenProjectBuilder.java:44)
    at org.jetbrains.idea.maven.wizards.MavenProjectBuilder$3.run(MavenProjectBuilder.java:179)
    at org.jetbrains.idea.maven.utils.MavenUtil$8.run(MavenUtil.java:388)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:469)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$6.run(ProgressManagerImpl.java:288)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:218)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:169)
    at com.intellij.openapi.application.impl.ApplicationImpl$8$1.run(ApplicationImpl.java:641)
    at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:434)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
    at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:145)
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: Connection timed out
    at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:120)
    at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:71)
    at org.jetbrains.idea.maven.server.RemoteObjectWrapper.getOrCreateWrappee(RemoteObjectWrapper.java:41)
    at org.jetbrains.idea.maven.server.MavenServerManager$8.execute(MavenServerManager.java:314)
    at org.jetbrains.idea.maven.server.MavenServerManager$8.execute(MavenServerManager.java:311)
    at org.jetbrains.idea.maven.server.RemoteObjectWrapper.perform(RemoteObjectWrapper.java:76)
    ... 27 more
Caused by: java.rmi.ConnectException: Connection refused to host: localhost; nested exception is: 
    java.net.ConnectException: Connection timed out
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
    at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at com.intellij.execution.rmi.RemoteProcessSupport$2.compute(RemoteProcessSupport.java:215)
    at com.intellij.execution.rmi.RemoteUtil.executeWithClassLoader(RemoteUtil.java:122)
    at com.intellij.execution.rmi.RemoteProcessSupport.acquire(RemoteProcessSupport.java:212)
    at com.intellij.execution.rmi.RemoteProcessSupport.acquire(RemoteProcessSupport.java:133)
    at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:117)
    ... 32 more
Caused by: java.net.ConnectException: Connection timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:529)
    at java.net.Socket.connect(Socket.java:478)
    at java.net.Socket.(Socket.java:375)
    at java.net.Socket.(Socket.java:189)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
    ... 41 more
2012-10-03 11:58:01,752 [ 143250]  ERROR - com.intellij.ide.IdeEventQueue - IntelliJ IDEA 11.1.3  Build #IC-117.798 
2012-10-03 11:58:01,752 [ 143250]  ERROR - com.intellij.ide.IdeEventQueue - JDK: 1.6.0_25 
2012-10-03 11:58:01,752 [ 143250]  ERROR - com.intellij.ide.IdeEventQueue - VM: Java HotSpot(TM) 64-Bit Server VM 
2012-10-03 11:58:01,752 [ 143250]  ERROR - com.intellij.ide.IdeEventQueue - Vendor: Sun Microsystems Inc. 
2012-10-03 11:58:01,752 [ 143250]  ERROR - com.intellij.ide.IdeEventQueue - OS: Linux 
2012-10-03 11:58:01,752 [ 143250]  ERROR - com.intellij.ide.IdeEventQueue - Last Action: OpenProject 
2012-10-03 11:58:01,752 [ 143250]  ERROR - com.intellij.ide.IdeEventQueue - Original exception:  
java.rmi.RemoteException: Cannot start maven service; nested exception is: 
    java.rmi.ConnectException: Connection refused to host: localhost; nested exception is: 
    java.net.ConnectException: Connection timed out
    at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:120)
    at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:71)
    at org.jetbrains.idea.maven.server.RemoteObjectWrapper.getOrCreateWrappee(RemoteObjectWrapper.java:41)
    at org.jetbrains.idea.maven.server.MavenServerManager$8.execute(MavenServerManager.java:314)
    at org.jetbrains.idea.maven.server.MavenServerManager$8.execute(MavenServerManager.java:311)
    at org.jetbrains.idea.maven.server.RemoteObjectWrapper.perform(RemoteObjectWrapper.java:76)
    at org.jetbrains.idea.maven.server.MavenServerManager.applyProfiles(MavenServerManager.java:311)
    at org.jetbrains.idea.maven.project.MavenProjectReader.applyProfiles(MavenProjectReader.java:369)
    at org.jetbrains.idea.maven.project.MavenProjectReader.doReadProjectModel(MavenProjectReader.java:98)
    at org.jetbrains.idea.maven.project.MavenProjectReader.readProject(MavenProjectReader.java:52)
    at org.jetbrains.idea.maven.project.MavenProject.read(MavenProject.java:405)
    at org.jetbrains.idea.maven.project.MavenProjectsTree.doUpdate(MavenProjectsTree.java:534)
    at org.jetbrains.idea.maven.project.MavenProjectsTree.doAdd(MavenProjectsTree.java:481)
    at org.jetbrains.idea.maven.project.MavenProjectsTree.update(MavenProjectsTree.java:442)
    at org.jetbrains.idea.maven.project.MavenProjectsTree.updateAll(MavenProjectsTree.java:413)
    at org.jetbrains.idea.maven.wizards.MavenProjectBuilder.readMavenProjectTree(MavenProjectBuilder.java:198)
    at org.jetbrains.idea.maven.wizards.MavenProjectBuilder.access$800(MavenProjectBuilder.java:44)
    at org.jetbrains.idea.maven.wizards.MavenProjectBuilder$3.run(MavenProjectBuilder.java:179)
    at org.jetbrains.idea.maven.utils.MavenUtil$8.run(MavenUtil.java:388)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:469)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$6.run(ProgressManagerImpl.java:288)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:218)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:169)
    at com.intellij.openapi.application.impl.ApplicationImpl$8$1.run(ApplicationImpl.java:641)
    at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:434)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
    at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:145)
Caused by: java.rmi.ConnectException: Connection refused to host: localhost; nested exception is: 
    java.net.ConnectException: Connection timed out
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
    at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at com.intellij.execution.rmi.RemoteProcessSupport$2.compute(RemoteProcessSupport.java:215)
    at com.intellij.execution.rmi.RemoteUtil.executeWithClassLoader(RemoteUtil.java:122)
    at com.intellij.execution.rmi.RemoteProcessSupport.acquire(RemoteProcessSupport.java:212)
    at com.intellij.execution.rmi.RemoteProcessSupport.acquire(RemoteProcessSupport.java:133)
    at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:117)
    ... 32 more
Caused by: java.net.ConnectException: Connection timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:529)
    at java.net.Socket.connect(Socket.java:478)
    at java.net.Socket.(Socket.java:375)
    at java.net.Socket.(Socket.java:189)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
    ... 41 more

I'm using the latest versions of IDEA (11.1.3) and Maven (3.0.4). Any ideas what I am doing wrong?

Upvotes: 37

Views: 57224

Answers (12)

Habib Qureshi
Habib Qureshi

Reputation: 31

In my case below line was set in ~/.profile

export _JAVA_OPTIONS="-Djava.net.preferIPv6Addresses=true

i just removed the line and rebooted. works fine after

Upvotes: 1

Zeus
Zeus

Reputation: 6566

I'm using the community edition 2017.2.1 and I had the same issue, I had to change the JDK version of the maven importer to the correct version(from 1.6 to 1.8) to make it work.

enter image description here

Upvotes: 43

Nsovo Ned Maluleke
Nsovo Ned Maluleke

Reputation: 1

I had the same issue on Linux Mint. Tried everything but nothing helped. Turned out my etc/hosts file was corrupted and restoring it worked. Another solution is here : https://www.digitalocean.com/community/questions/how-to-restore-etc-hosts-on-ubuntu-14-04

Upvotes: 0

CrazyCoder
CrazyCoder

Reputation: 401877

It's a common problem related to networking and address resolution. In some cases localhost may not resolve and it's required to have

127.0.0.1 localhost

in /etc/hosts file. Also make sure there are no other IP addresses mapped to localhost.

See my comment in the related YouTrack issue for more details.

Upvotes: 79

gjain
gjain

Reputation: 4518

Look for any (recently installed) applications that might prevent RemoteMavenServer from responding to Intellij's calls correctly. In my case, it turned out to be a an online accountability software:x3watch. After uninstalling it, Intellij started working fine.

Upvotes: 1

Najitaka
Najitaka

Reputation: 345

To correct this issue for me in 14.1.3 Ultimate, I had to add

-Didea.maven3.use.compat.resolver

to VM options for importer under Preferences > Build, Execution, Deployment > Build Tools > Importing

per the bug at https://youtrack.jetbrains.com/issue/IDEA-140208.

Upvotes: 12

rfelgent
rfelgent

Reputation: 9

I had similiar issue on

MAC OS X

what i did:

  • deactivated FIREWALL
  • set proxy in intellij (like explained in this thread)
  • set the ipstack-flag

nothing solved the problem...

what helped

  • starting intellij with Java 1.6 and NOT java 1.8 (defined in /Applications/IntelliJ\ IDEA\ 14.app/Contents/Info.plist )

strange

Upvotes: 0

vegaasen
vegaasen

Reputation: 1032

Had the same issue, however the following answer fixed my problem: Maven project won't compile after upgrade to Intellij 13.1 from 12

The problem itself occured after I updated to IntelliJ 13.1.4, pre to that patch all worked fine/as intended.

Upvotes: 0

Pandiarajan
Pandiarajan

Reputation: 430

I faced the same problem. Sorry, none of the above suggestions worked for me. In fact when I launch the gradle project from IntelliJ, I got error as "Connection refused: connect" in the event log. I tried various options like setting -Djava.net.preferIPv4Addresses=true, windows hot fix, installing ISA Client, Restarting machine, switched java lang level, disabled firewall. Nothing helped.

Finally giving the proxy information in the IntelliJ Idea does the trick for me.

enter image description here

Give the same proxy information as in your internet properties for IntelliJ proxy settings. enter image description here

Upvotes: 1

krešimir
krešimir

Reputation: 61

I had a similar issue running groovy script with IDEA 12. The problem was the same as @CrazyCoder stated. Solution was based on what @kevinmrohr did just a little easier to find and setup.

To solve the problem I edited idea.exe.vmoptions located in the bin directory (idea64.exe.vmoptions if you are using 64 bit version) and added -Djava.net.preferIPv4Stack=true.

Restarted IDEA and everything was working without any issues.

Upvotes: 6

kevinmrohr
kevinmrohr

Reputation: 831

I had this same problem. I don't know what caused it to start happening, I only know how I fixed it.

I found from looking at lsof -i -P that the maven remote server was attempting to run on IPv6, and apparently IntelliJ could not speak to it on IPv6. I'm not sure if it used to run on IPv4 and something caused it to start using IPv6, or if it always used IPv6 and a mac update somehow made it stop working.

Anyway, the solution I used was to edit /Applications/IntelliJ IDEA 11.app/Contents/Info.plist and add the java.net.preferIPv4Stack parameter to the java process:

<key>java</key>
<dict>
  <key>Properties</key>
  <dict>
    <key>java.net.preferIPv4Stack</key>
    <string>true</string>
  </dict>
</dict>

I really wish I could give more information about why this happened to begin with.

Upvotes: 3

noahlz
noahlz

Reputation: 10311

Find out what process on your machine is holding the port. On Ubuntu Linux, I executed the following commands:

ps -ef | grep idea

Noticed that there is a Java process running the class org.jetbrains.idea.maven.server.RemoteMavenServer

I noted the pid of 2772 and executed

netstat -anp | grep 2772

I noted that pid 2772 was listening on port 6942

I telneted to that port:

telnet localhost 6942
Trying 127.0.0.1...  
Connected to localhost.
Escape character is '^]'.
/home/noahlz/.IdeaIC11/config/ home/noahlz/.IdeaIC11/system

So the Maven component used by IntelliJ runs as a distinct server process, which IntelliJ speaks to over a socket. You'll need to determine why IntelliJ can't reach that server port on your machine, i.e. what other process is holding onto that port and/or not sending a response back to IntelliJ

Note that the port number on your machine might be different.

Upvotes: 1

Related Questions