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

[I] [Bug]: Getting error while reading struct type node value and it's attributes

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

   ### What happened?
   
   My OPCUA node ID is like so -> ns=6;s=Arp.Plc.Eclr/THYROBOX_COMPLETE_SYS.R_200
   
   I have created a testing Python script that easily reads this address, but when I use PLC4X, I get an error. I have tried building the addresses as such for PLC4X ->
   1. ns=6;s=Arp.Plc.Eclr/THYROBOX_COMPLETE_SYS.R_200;WORD
   2. ns=6;s=Arp.Plc.Eclr/THYROBOX_COMPLETE_SYS/R_200;WORD
   3. ns=6;s=Arp.Plc.Eclr/THYROBOX_COMPLETE_SYS;a=R_200;WORD
   
   Error ->
   ```
   java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "org.apache.plc4x.java.spi.messages.utils.PlcTagItem.getResponseCode()" because the return value of "java.util.LinkedHashMap.get(Object)" is null
   	at java.base/java.util.concurrent.CompletableFuture.wrapInExecutionException(Unknown Source)
   	at java.base/java.util.concurrent.CompletableFuture.reportGet(Unknown Source)
   	at java.base/java.util.concurrent.CompletableFuture.get(Unknown Source)
   	at com.example.plc.polling.AbstractPlc4xPoller.run(AbstractPlc4xPoller.java:108)
   	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
   	at java.base/java.util.concurrent.FutureTask.runAndReset(Unknown Source)
   	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
   	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
   	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   	at java.base/java.lang.Thread.run(Unknown Source)
   Caused by: java.lang.NullPointerException: Cannot invoke "org.apache.plc4x.java.spi.messages.utils.PlcTagItem.getResponseCode()" because the return value of "java.util.LinkedHashMap.get(Object)" is null
   	at org.apache.plc4x.java.spi.messages.DefaultPlcReadRequest.getTagResponseCode(DefaultPlcReadRequest.java:86)
   	at org.apache.plc4x.java.spi.connection.AbstractPlcConnection.lambda$0(AbstractPlcConnection.java:221)
   	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source)
   	at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
   	at java.base/java.util.concurrent.CompletableFuture.complete(Unknown Source)
   	at org.apache.plc4x.java.spi.optimizer.BaseOptimizer.lambda$8(BaseOptimizer.java:206)
   	at java.base/java.util.concurrent.CompletableFuture.uniHandle(Unknown Source)
   	at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(Unknown Source)
   	at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
   	at java.base/java.util.concurrent.CompletableFuture.complete(Unknown Source)
   	at org.apache.plc4x.java.opcua.protocol.OpcuaProtocolLogic.bridge(OpcuaProtocolLogic.java:899)
   	at org.apache.plc4x.java.opcua.protocol.OpcuaProtocolLogic.lambda$8(OpcuaProtocolLogic.java:246)
   	at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(Unknown Source)
   	at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(Unknown Source)
   	at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
   	at java.base/java.util.concurrent.CompletableFuture.complete(Unknown Source)
   	at org.apache.plc4x.java.opcua.context.Conversation.lambda$38(Conversation.java:342)
   	at java.base/java.util.function.Consumer.lambda$andThen$0(Unknown Source)
   	at org.apache.plc4x.java.spi.Plc4xNettyWrapper.decode(Plc4xNettyWrapper.java:194)
   	at io.netty.handler.codec.MessageToMessageCodec$1.decode(MessageToMessageCodec.java:67)
   	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:91)
   	at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:120)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
   	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
   	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:107)
   	at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:120)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
   	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
   	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
   	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)
   	at io.netty.handler.codec.ByteToMessageCodec.channelRead(ByteToMessageCodec.java:103)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
   	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
   	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1357)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
   	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:868)
   	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
   	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:796)
   	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:732)
   	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:658)
   	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
   	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:998)
   	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
   	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
   	... 1 common frames omitted
   ```
   
   Is there any other way of reading OPCUA struct attributes in PLC4X?
   
   ### Version
   
   v0.13.0-SNAPSHOT
   
   ### 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
   - [x] OPC-UA
   - [ ] Profinet
   - [ ] 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]: Getting error while reading struct type node value and it's attributes

Posted by "parthgoel06 (via GitHub)" <gi...@apache.org>.
parthgoel06 closed issue #2136: [Bug]: Getting error while reading struct type node value and it's attributes
URL: https://github.com/apache/plc4x/issues/2136


-- 
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]: Getting error while reading struct type node value and it's attributes

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

   Never mind, the issue was in data type WORD, worked using ns=6;s=Arp.Plc.Eclr/THYROBOX_COMPLETE_SYS.R_200;INT


-- 
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