背景
在IDEA中写了测试代码,但是运行的时候一直提示 java.lang.IllegalStateException: failed to create a child event loop ...
eclipse中同样的代码运行没有问题,于是搜索了一些关于这个错误的解决方法,基本上说是防火墙引起的,需要在防火墙允许应用运行中添加例外应用,添加IDEA即可。
但是,尝试了以后,还是不行......
Error:Abnormal build process termination:
C:\Condition\jdk1.8.0_171\bin\java -Xmx700m -Djava.awt.headless=true -Djava.endorsed.dirs=\"\" -Djdt.compiler.useSingleThread=true -Dpreload.project.path=G:/WS-Idea/freemarker-word -Dpreload.config.path=C:/Users/love2/.IntelliJIdea2017.2/config/options -Dcompile.parallel=false -Drebuild.on.dependency.change=true -Djava.net.preferIPv4Stack=true -Dio.netty.initialSeedUniquifier=599254584395996903 -Dfile.encoding=GBK -Djps.file.types.component.name=FileTypeManager -Duser.language=zh -Duser.country=CN -Didea.paths.selector=IntelliJIdea2017.2 "-Didea.home.path=C:\SoftWare\IntelliJ IDEA 2017.2" -Didea.config.path=C:\Users\love2\.IntelliJIdea2017.2\config -Didea.plugins.path=C:\Users\love2\.IntelliJIdea2017.2\config\plugins -Djps.log.dir=C:/Users/love2/.IntelliJIdea2017.2/system/log/build-log "-Djps.fallback.jdk.home=C:/SoftWare/IntelliJ IDEA 2017.2/jre64" -Djps.fallback.jdk.version=1.8.0_152-release -Dio.netty.noUnsafe=true -Djava.io.tmpdir=C:/Users/love2/.IntelliJIdea2017.2/system/compile-server/freemarker-word_2c2f109d/_temp_ -Djps.backward.ref.index.builder=true -Dkotlin.incremental.compilation.experimental=true -Dkotlin.daemon.enabled -Dkotlin.daemon.client.alive.path=\"C:\Users\love2\AppData\Local\Temp\kotlin-idea-7326061649601543174-is-running\" -classpath "C:/SoftWare/IntelliJ IDEA 2017.2/lib/jps-launcher.jar;C:/Condition/jdk1.8.0_171/lib/tools.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/optimizedFileManager.jar" org.jetbrains.jps.cmdline.Launcher "C:/SoftWare/IntelliJ IDEA 2017.2/lib/asm-all.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/jgoodies-forms.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/forms_rt.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/javac2.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/jdom.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/maven-aether-provider-3.3.9-all.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/jps-builders-6.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/protobuf-2.5.0.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/aether-1.1.0-all.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/httpcore-4.4.5.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/aether-dependency-resolver.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/nanoxml-2.2.3.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/jps-builders.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/annotations.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/snappy-in-java-0.5.1.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/jps-model.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/oromatcher.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/commons-codec-1.9.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/slf4j-api-1.7.10.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/jna.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/resources_en.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/commons-logging-1.2.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/openapi.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/httpclient-4.5.2.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/jna-platform.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/netty-all-4.1.10.Final.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/util.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/idea_rt.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/log4j.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/trove4j.jar;;C:/SoftWare/IntelliJ IDEA 2017.2/lib/gson-2.5.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/android/lib/jarutils.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/guava-21.0.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/android/lib/android-common.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/gradle/lib/gradle-tooling-api-3.5.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/gson-2.5.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/android/lib/jarutils.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/guava-21.0.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/android/lib/android-common.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/gradle/lib/gradle-tooling-api-3.5.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/ant/lib/ant-jps-plugin.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/devkit/lib/devkit-jps-plugin.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/uiDesigner/lib/jps/ui-designer-jps-plugin.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/IntelliLang/lib/intellilang-jps-plugin.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/Groovy/lib/groovy-jps-plugin.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/Groovy/lib/groovy-rt-constants.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/eclipse/lib/eclipse-jps-plugin.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/eclipse/lib/common-eclipse-util.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/maven/lib/maven-jps-plugin.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/maven/lib/plexus-utils-2.0.6.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/osmorc/lib/osmorc-jps-plugin.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/osmorc/lib/bndlib-3.3.0.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/osmorc/lib/bnd-repository-3.3.0.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/osmorc/lib/bnd-resolve-3.3.0.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/osmorc/lib/plexus-utils-3.0.10.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/osmorc/lib/bundlor-all.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/aspectj/lib/aspectj-jps-plugin.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/flex/lib/flex-jps-plugin.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/flex/lib/flex-shared.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/gradle/lib/gradle-jps-plugin.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/JavaEE/lib/javaee-jps-plugin.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/JavaEE/lib/jps/jpa-jps-plugin.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/webSphereIntegration/lib/jps/webSphere-jps-plugin.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/weblogicIntegration/lib/jps/weblogic-jps-plugin.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/dmServer/lib/dmServer-jps-plugin.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/GwtStudio/lib/gwt-jps-plugin.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/GoogleAppEngine/lib/google-app-engine-jps-plugin.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/GoogleAppEngine/lib/appEngine-runtime.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/Grails/lib/grails-jps-plugin.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/Grails/lib/grails-compiler-patch.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/android/lib/jps/android-jps-plugin.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/android/lib/jps/android-gradle-jps.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/android/lib/android-common.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/android/lib/android-rt.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/android/lib/sdk-common.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/android/lib/repository.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/android/lib/sdklib.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/android/lib/jarutils.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/android/lib/layoutlib-api.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/android/lib/manifest-merger.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/Kotlin/lib/jps/kotlin-jps-plugin.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/Kotlin/lib/kotlin-runtime.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/Kotlin/lib/kotlin-reflect.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/Kotlin/lib/kotlin-plugin.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/Kotlin/lib/android-extensions-ide.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/Kotlin/lib/android-extensions-compiler.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/javaFX/lib/javaFX-jps-plugin.jar;C:/SoftWare/IntelliJ IDEA 2017.2/plugins/javaFX/lib/common-javaFX-plugin.jar" org.jetbrains.jps.cmdline.BuildMain 127.0.0.1 58948 c9773f86-c496-4840-9a36-cf9f6f36178d C:/Users/love2/.IntelliJIdea2017.2/system/compile-server
Build process started. Classpath: C:/SoftWare/IntelliJ IDEA 2017.2/lib/jps-launcher.jar;C:/Condition/jdk1.8.0_171/lib/tools.jar;C:/SoftWare/IntelliJ IDEA 2017.2/lib/optimizedFileManager.jarSLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Error connecting to 127.0.0.1:58948; reason: failed to create a child event loop
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.channel.MultithreadEventLoopGroup.<init>(MultithreadEventLoopGroup.java:52)
at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:87)
at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:82)
at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:63)
at org.jetbrains.jps.cmdline.BuildMain.main(BuildMain.java:88)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jetbrains.jps.cmdline.Launcher.main(Launcher.java:59)
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:149)
at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:127)
at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:36)
at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:84)
... 11 more
Caused by: java.io.IOException: Unable to establish loopback connection
at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:94)
at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:61)
at java.security.AccessController.doPrivileged(Native Method)
at sun.nio.ch.PipeImpl.<init>(PipeImpl.java:171)
at sun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:50)
at java.nio.channels.Pipe.open(Pipe.java:155)
at sun.nio.ch.WindowsSelectorImpl.<init>(WindowsSelectorImpl.java:127)
at sun.nio.ch.WindowsSelectorProvider.openSelector(WindowsSelectorProvider.java:44)
at io.netty.channel.nio.NioEventLoop.openSelector(NioEventLoop.java:173)
... 15 more
Caused by: java.net.ConnectException: Connection timed out: connect
at sun.nio.ch.Net.connect0(Native Method)
at sun.nio.ch.Net.connect(Net.java:454)
at sun.nio.ch.Net.connect(Net.java:446)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:648)
at java.nio.channels.SocketChannel.open(SocketChannel.java:189)
at sun.nio.ch.PipeImpl$Initializer$LoopbackConnector.run(PipeImpl.java:127)
at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:76)
... 23 more
Exiting.
解决策略
万般无奈之下,萌生了卸载,重新安装的念头,还好坚持了一下,在Stack overflow 找了一下资料。最终,还是找到了解决办法。刚开始直接强制关闭防火墙,此时IDEA可以正常运行程序。既然这样,就可以确定的确是和防火墙有关!但是也不能一直关闭防火墙呀,所以,还是只能添加IDEA防火墙例外应用。
之前添加例外应用时,位置我指定的是IDEA的安装目录bin中的idea.exe,不起作用。位置指定到开始菜单应用程序IDEA,是可以的。具体原因不知道了......
原文地址:https://www.cnblogs.com/lyc-smile/p/10523628.html
时间: 2024-10-11 05:29:28