You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@plc4x.apache.org by "DHANABALAN DURAIRAJASIVAM (Jira)" <ji...@apache.org> on 2022/05/30 05:33:00 UTC

[jira] [Commented] (PLC4X-326) org.apache.plc4x.java.api.exceptions.PlcConnectionException: Error creating channel

    [ https://issues.apache.org/jira/browse/PLC4X-326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543780#comment-17543780 ] 

DHANABALAN DURAIRAJASIVAM commented on PLC4X-326:
-------------------------------------------------

Hi Christofer Dutz,

                             My apologies for my very later response.

Yes, you were right, When I build the jar file, the maven build did not copy all the artifacts (at least related to PLC4x libs). I had to handle the artifacts manually to build the working jar.  thanks a lot for your support. :)

> org.apache.plc4x.java.api.exceptions.PlcConnectionException: Error creating channel
> -----------------------------------------------------------------------------------
>
>                 Key: PLC4X-326
>                 URL: https://issues.apache.org/jira/browse/PLC4X-326
>             Project: Apache PLC4X
>          Issue Type: Bug
>          Components: Driver-Modbus
>    Affects Versions: 0.9.0
>            Reporter: DHANABALAN DURAIRAJASIVAM
>            Priority: Critical
>
> Hello All,
>                  I have used to poll the Modbus Registers every 10 Seconds and for modbus connection, I have used the connection Code from example given. (see below).
> _try (PlcConnection plcConnection = new PlcDriverManager().getConnection(connectionString)) \{ ... do something with the connection here ... }_
>  
> _Above code  created in a bean and bean has been called by camel producer every 10 sec._
> *The Question is ,does this above code close the connection itself when repeatedly called by new instance? or we need to handle connection close?*
> *Exception.*
> org.apache.plc4x.java.api.exceptions.PlcConnectionException: Error creating channel.
>     at org.apache.plc4x.java.spi.connection.NettyChannelFactory.createChannel(NettyChannelFactory.java:130)
>     at org.apache.plc4x.java.spi.connection.DefaultNettyPlcConnection.connect(DefaultNettyPlcConnection.java:121)
>     at org.apache.plc4x.java.PlcDriverManager.getConnection(PlcDriverManager.java:74)
>     at com.jtc.evcharger.bean.ModbusScan.GetEvChargerData(ModbusScan.java:82)
>     at jdk.internal.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)
>     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>     at java.base/java.lang.reflect.Method.invoke(Unknown Source)
>     at org.apache.camel.support.ObjectHelper.invokeMethodSafe(ObjectHelper.java:382)
>     at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:494)
>     at org.apache.camel.component.bean.MethodInfo$1.doProceed(MethodInfo.java:316)
>     at org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:286)
>     at org.apache.camel.component.bean.AbstractBeanProcessor.process(AbstractBeanProcessor.java:146)
>     at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:81)
>     at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:463)
>     at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:179)
>     at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:64)
>     at org.apache.camel.processor.Pipeline.process(Pipeline.java:184)
>     at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:398)
>     at org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:210)
>     at org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:76)
>     at java.base/java.util.TimerThread.mainLoop(Unknown Source)
>     at java.base/java.util.TimerThread.run(Unknown Source)
> 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:60)
>     at io.netty.channel.MultithreadEventLoopGroup.<init>(MultithreadEventLoopGroup.java:52)
>     at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:97)
>     at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:92)
>     at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:73)
>     at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:53)
>     at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:45)
>     at org.apache.plc4x.java.spi.connection.NettyChannelFactory.getEventLoopGroup(NettyChannelFactory.java:86)
>     at org.apache.plc4x.java.spi.connection.NettyChannelFactory.createChannel(NettyChannelFactory.java:94)
>     ... 21 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:183)
>     at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:38)
>     at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:84)
>     ... 30 more
> Caused by: java.io.IOException: Too many open files
>     at java.base/sun.nio.ch.EPoll.create(Native Method)
>     at java.base/sun.nio.ch.EPollSelectorImpl.<init>(Unknown Source)
>     at java.base/sun.nio.ch.EPollSelectorProvider.openSelector(Unknown Source)
>     at io.netty.channel.nio.NioEventLoop.openSelector(NioEventLoop.java:173)
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)