I am having a trouble with launching Intellij Idea Ultimate Edition 2021.1.2 (also tried 2020.3.1) with VPN enabled (I am using GlobalProtect) on Windows 10. I’ve been working on this setup for quite a long time, but recently something went wrong with no obvious changes made. So, after launching Intellij Idea I get an error window with following:
java.util.concurrent.CompletionException: java.lang.IllegalStateException: failed to create a child event loop at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314) at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319) at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1702) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: java.lang.IllegalStateException: failed to create a child event loop at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:88) at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:58) at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:47) at io.netty.channel.MultithreadEventLoopGroup.<init>(MultithreadEventLoopGroup.java:59) at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:86) at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:81) at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:68) at org.jetbrains.io.BuiltInServerKt.multiThreadEventLoopGroup(BuiltInServer.kt:144) at org.jetbrains.io.BuiltInServerKt.access$multiThreadEventLoopGroup(BuiltInServer.kt:1) at org.jetbrains.io.BuiltInServer$Companion.start(BuiltInServer.kt:54) at org.jetbrains.io.BuiltInServer.start(BuiltInServer.kt) at com.intellij.idea.SocketLock.lambda$lockAndTryActivate$2(SocketLock.java:171) at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700) ... 7 more Caused by: io.netty.channel.ChannelException: failed to open a new selector at io.netty.channel.nio.NioEventLoop.openSelector(NioEventLoop.java:175) at io.netty.channel.nio.NioEventLoop.<init>(NioEventLoop.java:142) at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:146) at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:37) at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:84) ... 19 more Caused by: java.io.IOException: Unable to establish loopback connection at java.base/sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:94) at java.base/sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:61) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/sun.nio.ch.PipeImpl.<init>(PipeImpl.java:171) at java.base/sun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:50) at java.base/java.nio.channels.Pipe.open(Pipe.java:155) at java.base/sun.nio.ch.WindowsSelectorImpl.<init>(WindowsSelectorImpl.java:142) at java.base/sun.nio.ch.WindowsSelectorProvider.openSelector(WindowsSelectorProvider.java:44) at io.netty.channel.nio.NioEventLoop.openSelector(NioEventLoop.java:173) ... 23 more Caused by: java.net.BindException: Cannot assign requested address: connect at java.base/sun.nio.ch.Net.connect0(Native Method) at java.base/sun.nio.ch.Net.connect(Net.java:476) at java.base/sun.nio.ch.Net.connect(Net.java:468) at java.base/sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:692) at java.base/java.nio.channels.SocketChannel.open(SocketChannel.java:194) at java.base/sun.nio.ch.PipeImpl$Initializer$LoopbackConnector.run(PipeImpl.java:127) at java.base/sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:76) ... 31 more ----- Your JRE: 11.0.11+9-b1341.57 amd64 (JetBrains s.r.o.) C:Program FilesJetBrainsIntelliJ IDEA 2021.1.2jbr
After I prees OK button IDE shuts down. If I disable VPN everything works fine.
After some research I found the way to start Idea with VPN enabled with VM option -Djava.net.preferIPv4Stack=true
, but that really doesn’t solve the problem, because I still need VPN for my project.
If I start Idea and then enable VPN, after I try to start project I get Cannot assign requested address: no further information
message from Gradle. Or if I simply open Maven project, I get
org.jetbrains.idea.maven.server.CannotStartServerException: java.util.concurrent.ExecutionException: java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is: java.net.ConnectException: connect: Address is invalid on local machine, or port is not valid on remote machine at org.jetbrains.idea.maven.server.MavenServerConnectorImpl.getServer(MavenServerConnectorImpl.java:100) at org.jetbrains.idea.maven.server.MavenServerConnector.lambda$applyProfiles$3(MavenServerConnector.java:85) at org.jetbrains.idea.maven.server.MavenServerConnectorImpl.perform(MavenServerConnectorImpl.java:169) at org.jetbrains.idea.maven.server.MavenServerConnector.applyProfiles(MavenServerConnector.java:84) at org.jetbrains.idea.maven.project.MavenProjectReader.applyProfiles(MavenProjectReader.java:422) at org.jetbrains.idea.maven.project.MavenProjectReader.doReadProjectModel(MavenProjectReader.java:98) at org.jetbrains.idea.maven.project.MavenProjectReader$1.doProcessParent(MavenProjectReader.java:479) at org.jetbrains.idea.maven.project.MavenProjectReader$1.doProcessParent(MavenProjectReader.java:455) at org.jetbrains.idea.maven.project.MavenParentProjectFileProcessor.processRepositoryParent(MavenParentProjectFileProcessor.java:84) at org.jetbrains.idea.maven.project.MavenParentProjectFileProcessor.process(MavenParentProjectFileProcessor.java:62) at org.jetbrains.idea.maven.project.MavenProjectReader.resolveInheritance(MavenProjectReader.java:482) at org.jetbrains.idea.maven.project.MavenProjectReader.doReadProjectModel(MavenProjectReader.java:95) at org.jetbrains.idea.maven.project.MavenProjectReader$1.doProcessParent(MavenProjectReader.java:479) at org.jetbrains.idea.maven.project.MavenProjectReader$1.doProcessParent(MavenProjectReader.java:455) at org.jetbrains.idea.maven.project.MavenParentProjectFileProcessor.processRepositoryParent(MavenParentProjectFileProcessor.java:84) at org.jetbrains.idea.maven.project.MavenParentProjectFileProcessor.process(MavenParentProjectFileProcessor.java:62) at org.jetbrains.idea.maven.project.MavenProjectReader.resolveInheritance(MavenProjectReader.java:482) at org.jetbrains.idea.maven.project.MavenProjectReader.doReadProjectModel(MavenProjectReader.java:95) at org.jetbrains.idea.maven.project.MavenProjectReader.readProject(MavenProjectReader.java:56) at org.jetbrains.idea.maven.project.MavenProject.read(MavenProject.java:683) at org.jetbrains.idea.maven.project.MavenProjectsTree.doUpdate(MavenProjectsTree.java:549) at org.jetbrains.idea.maven.project.MavenProjectsTree.update(MavenProjectsTree.java:459) at org.jetbrains.idea.maven.project.MavenProjectsTree.updateAll(MavenProjectsTree.java:427) at org.jetbrains.idea.maven.project.MavenProjectsProcessorReadingTask.perform(MavenProjectsProcessorReadingTask.java:61) at org.jetbrains.idea.maven.project.MavenProjectsProcessor.doProcessPendingTasks(MavenProjectsProcessor.java:146) at org.jetbrains.idea.maven.project.MavenProjectsProcessor$1.run(MavenProjectsProcessor.java:115) at org.jetbrains.idea.maven.utils.MavenUtil.lambda$runInBackground$6(MavenUtil.java:536) at com.intellij.util.RunnableCallable.call(RunnableCallable.java:20) at com.intellij.util.RunnableCallable.call(RunnableCallable.java:11) at com.intellij.openapi.application.impl.ApplicationImpl$1.call(ApplicationImpl.java:265) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: java.util.concurrent.ExecutionException: java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is: java.net.ConnectException: connect: Address is invalid on local machine, or port is not valid on remote machine at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395) at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999) at org.jetbrains.concurrency.AsyncPromise.get(AsyncPromise.kt:42) at org.jetbrains.idea.maven.server.MavenServerConnectorImpl.waitForServer(MavenServerConnectorImpl.java:117) at org.jetbrains.idea.maven.server.MavenServerConnectorImpl.getServer(MavenServerConnectorImpl.java:83) ... 37 more Caused by: java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is: java.net.ConnectException: connect: Address is invalid on local machine, or port is not valid on remote machine at java.rmi/sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:623) at java.rmi/sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:209) at java.rmi/sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:196) at java.rmi/sun.rmi.server.UnicastRef.newCall(UnicastRef.java:343) at java.rmi/sun.rmi.registry.RegistryImpl_Stub.lookup(RegistryImpl_Stub.java:116) at com.intellij.execution.rmi.RemoteProcessSupport.lambda$acquire$2(RemoteProcessSupport.java:316) at com.intellij.openapi.util.ClassLoaderUtil.computeWithClassLoader(ClassLoaderUtil.java:31) at com.intellij.execution.rmi.RemoteUtil.executeWithClassLoader(RemoteUtil.java:202) at com.intellij.execution.rmi.RemoteProcessSupport.acquire(RemoteProcessSupport.java:314) at com.intellij.execution.rmi.RemoteProcessSupport.acquire(RemoteProcessSupport.java:188) at org.jetbrains.idea.maven.server.MavenServerConnectorImpl$StartServerTask.run(MavenServerConnectorImpl.java:247) ... 11 more Caused by: java.net.ConnectException: connect: Address is invalid on local machine, or port is not valid on remote machine at java.base/java.net.PlainSocketImpl.connect0(Native Method) at java.base/java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:101) at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399) at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242) at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224) at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.base/java.net.Socket.connect(Socket.java:609) at java.base/java.net.Socket.connect(Socket.java:558) at java.base/java.net.Socket.<init>(Socket.java:454) at java.base/java.net.Socket.<init>(Socket.java:231) at com.intellij.execution.rmi.RemoteServer$1.createSocket(RemoteServer.java:174) at java.rmi/sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:617) ... 21 more
Any ideas on how to resolve this issue?
Advertisement
Answer
Adding system variable _JAVA_OPTIONS:-Djava.net.preferIPv4Stack=true
resolved all issues