You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@plc4x.apache.org by "JordanFromChina (via GitHub)" <gi...@apache.org> on 2025/12/15 03:07:36 UTC

[I] [Bug]: NullPointerException

JordanFromChina opened a new issue, #2394:
URL: https://github.com/apache/plc4x/issues/2394

   ### What happened?
   
   // connected a S1500 PLC and cache it
   // create PlcReadRequest  instance and cache it
   //get PlcReadRequest  from cache
   //a loop call program below 
   ```
   
   PlcReadRequest readRequest = cachedRequest.get(...);
   PlcReadResponse response = readRequest.execute()
     .get(OpcConfig.synchronized_millisecond * 30, TimeUnit.MILLISECONDS);
   
   Thread.sleep(100);
   PlcResponseCode code;
   Object value;
   for (String fieldName : response.getTagNames()) {
           try {
               code = response.getResponseCode(fieldName);
               if (code == PlcResponseCode.OK) {
                   ....
               } else { 
                 log.error("field: {} responseCode: {}", fieldName, code);
               }
       }
       catch (InterruptedException e) {
       	throw e;
       }
       catch (Exception e) {
           String msg = e.getMessage();
           log.error(fieldName , e);
   }
   ```
   
   the logback file logged errors below sometimes
   
   [plc4x-tm-thread-1] i.n.c.e.EmbeddedChannel - More than one exception was raised. Will report only the first one and log others.
   java.lang.NullPointerException: Cannot invoke "io.netty.channel.ChannelPromise.setUncancellable()" because "entry.promise" is null
   	at io.netty.channel.ChannelOutboundBuffer.addFlush(ChannelOutboundBuffer.java:150)
   	at io.netty.channel.AbstractChannel$AbstractUnsafe.flush(AbstractChannel.java:894)
   	at io.netty.channel.embedded.EmbeddedChannel$EmbeddedUnsafe$1.flush(EmbeddedChannel.java:894)
   	at io.netty.channel.DefaultChannelPipeline$HeadContext.flush(DefaultChannelPipeline.java:1372)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:921)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:907)
   	at io.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:893)
   	at io.netty.channel.ChannelDuplexHandler.flush(ChannelDuplexHandler.java:127)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:923)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:941)
   	at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:966)
   	at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:934)
   	at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:984)
   	at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1025)
   	at org.apache.plc4x.java.spi.Plc4xNettyWrapper$1.sendToWire(Plc4xNettyWrapper.java:100)
   	at org.apache.plc4x.java.spi.internal.DefaultSendRequestContext.handle(DefaultSendRequestContext.java:108)
   	at org.apache.plc4x.java.spi.internal.DefaultSendRequestContext.handle(DefaultSendRequestContext.java:1)
   	at org.apache.plc4x.java.s7.readwrite.protocol.S7ProtocolLogic.lambda$42(S7ProtocolLogic.java:1535)
   	at org.apache.plc4x.java.spi.transaction.RequestTransactionManager$TransactionOperation.run(RequestTransactionManager.java:225)
   	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
   	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
   	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
   	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
   	at java.base/java.lang.Thread.run(Thread.java:840)
   
   
   
   
   ### Version
   
   v0.13.1
   
   ### Programming Languages
   
   - [ ] plc4c
   - [ ] plc4go
   - [x] plc4j
   - [ ] plc4net
   - [ ] plc4py
   
   ### Protocols
   
   - [ ] AB-Ethernet
   - [ ] ADS /AMS
   - [ ] BACnet/IP
   - [ ] C-Bus
   - [ ] CANopen
   - [ ] EtherNet/IP
   - [ ] Firmata
   - [ ] IEC-69870
   - [ ] KNXnet/IP
   - [ ] Modbus
   - [ ] OPC-UA
   - [ ] Profinet
   - [x] S7
   - [ ] S7-light


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@plc4x.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: NullPointerException

Posted by "chrisdutz (via GitHub)" <gi...@apache.org>.
chrisdutz commented on issue #2394:
URL: https://github.com/apache/plc4x/issues/2394#issuecomment-3654334384

   Please try using the "s7-light" driver instead. If you're using a S7-1500 you can't use the communication form the s7 supports in addition to the s7-light anyway. 
   
   I built that to avoid such hard to trace back issues.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: NullPointerException

Posted by "chrisdutz (via GitHub)" <gi...@apache.org>.
chrisdutz commented on issue #2394:
URL: https://github.com/apache/plc4x/issues/2394#issuecomment-5290978207

   The S7 driver was completley rewritten ... Claude marked this issue as obsolete. Closing it for that ... if you still happen to run into this, please feel free to open a new issue after testing with the 1.0.0 version (-SNAPSHOT or the full version after it's released)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: NullPointerException

Posted by "chrisdutz (via GitHub)" <gi...@apache.org>.
chrisdutz closed issue #2394: [Bug]: NullPointerException
URL: https://github.com/apache/plc4x/issues/2394


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org