question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

how to fix this java.lang.IllegalStateException:failed to create a child event loop err

See original GitHub issue

java.lang.IllegalStateException:failed to create a child event loop 2 io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(SourceFile:99) 3 … 4 Caused by: 5 java.io.IOException:Too many open files 6 sun.nio.ch.IOUtil.makePipe(Native Method) 7 sun.nio.ch.PollSelectorImpl.<init>(PollSelectorImpl.java:57) 8 sun.nio.ch.PollSelectorProvider.openSelector(PollSelectorProvider.java:36) 9 io.netty.channel.nio.NioEventLoop.openSelector(SourceFile:124) 10 io.netty.channel.nio.NioEventLoop.<init>(SourceFile:118) 11 io.netty.channel.nio.NioEventLoopGroup.newChild(SourceFile:140) 12 io.netty.channel.nio.NioEventLoopGroup.newChild(SourceFile:31) 13 io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(SourceFile:95) 14 io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(SourceFile:68) 15 io.netty.channel.MultithreadEventLoopGroup.<init>(SourceFile:49) 16 io.netty.channel.nio.NioEventLoopGroup.<init>(SourceFile:100) 17 io.netty.channel.nio.NioEventLoopGroup.<init>(SourceFile:71) 18 io.netty.channel.nio.NioEventLoopGroup.<init>(SourceFile:56) 19 io.netty.channel.nio.NioEventLoopGroup.<init>(SourceFile:41) 20 com.ninexiu.sixninexiu.common.util.m.<init>(SourceFile:71) 21 com.ninexiu.sixninexiu.common.util.m.a(SourceFile:140) 22 com.ninexiu.sixninexiu.d.bm$3.run(SourceFile:1225) 23 android.os.Handler.handleCallback(Handler.java:761) 24 android.os.Handler.dispatchMessage(Handler.java:98) 25 android.os.Looper.loop(Looper.java:156) 26 android.app.ActivityThread.main(ActivityThread.java:6577) 27 java.lang.reflect.Method.invoke(Native Method) 28 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941) 29 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831)

I use this version: netty-all-5.0.0.Alpha2.jar in Android app . this is my init code group = new NioEventLoopGroup(); bootstrap = new Bootstrap(); bootstrap.channel(NioSocketChannel.class); bootstrap.option(ChannelOption.SO_KEEPALIVE, true) .option(ChannelOption.SO_BACKLOG, 10000) .option(ChannelOption.SO_REUSEADDR, true) .option(ChannelOption.TCP_NODELAY, true) .option(ChannelOption.SO_LINGER, 0) .option(ChannelOption.SO_KEEPALIVE, true) .option(ChannelOption.SO_RCVBUF, 8192) .option(ChannelOption.SO_SNDBUF, 8192); bootstrap.group(group); bootstrap.handler(new ChannelInitializer<SocketChannel>() { @Override public void initChannel(SocketChannel ch) throws Exception { ChannelPipeline channelPipeline = ch.pipeline(); channelPipeline.addLast(new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE, 0, 2, -2, 2)); channelPipeline.addLast(new MessageBinaryDecoder()); channelPipeline.addLast(new MessageEncoder()); channelPipeline.addLast(new ChatClientHandler(mHandler)); } });

and this is my disconnect code public void disconnect() { try { if(ch!=null){ ch.disconnect(); ch.close(); ch = null; } } catch (Exception e) { e.printStackTrace(); } }

I don’t understand why cause this err.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
vasily802commented, Apr 16, 2019

How can this be fixed on a mac?

2reactions
Scottmitchcommented, Sep 22, 2017

5.0 has been abandoned. Please use the latest 4.1 release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

intellij idea - Failed to create a child event loop - Stack Overflow
Compiling newly created Hello World program · Update IntelliJ · Uninstall & Reinstall · Allow from Windows Firewall rule · Disabling Antivirus Program....
Read more >
java.lang.IllegalStateException: failed to create a child event ...
Description: mouseClicked event handler java.lang.IllegalStateException: failed to create a child event loop at io.netty.util.concurrent.
Read more >
java.lang.IllegalStateException: failed to create a child event ...
Startup error: java.lang.IllegalStateException: failed to create a child event loop. Relates to 1. Relates to 1 issue (0 unresolved).
Read more >
FIX 2022 Error: java.lang.IllegalStateException failed to create ...
FIX 2022 Error : java. lang. IllegalStateException failed to create a child event loop.
Read more >
"Failed to create a Child event loop"? After upgrading to Java ...
Guys at r/minecraft couldn't help, maybe r/java knows the fix? ... IllegalStateException: failed to create a child event loop at io.netty.util.concurrent.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found