You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
org.opentest4j.AssertionFailedError: Unexpected exception thrown: java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "tag" is null
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:152)
at org.junit.jupiter.api.AssertDoesNotThrow.createAssertionFailedError(AssertDoesNotThrow.java:84)
at org.junit.jupiter.api.AssertDoesNotThrow.assertDoesNotThrow(AssertDoesNotThrow.java:75)
at org.junit.jupiter.api.AssertDoesNotThrow.assertDoesNotThrow(AssertDoesNotThrow.java:58)
at org.junit.jupiter.api.Assertions.assertDoesNotThrow(Assertions.java:3228)
at org.apache.plc4x.java.modbus.rtu.ModbusRtuPingTest.testPing(ModbusRtuPingTest.java:30)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
Caused by: java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "tag" is null
at org.apache.plc4x.java.modbus.base.protocol.ModbusProtocolLogic.getReadRequestPdu(ModbusProtocolLogic.java:149)
at org.apache.plc4x.java.modbus.rtu.protocol.ModbusRtuProtocolLogic.ping(ModbusRtuProtocolLogic.java:68)
at org.apache.plc4x.java.spi.connection.AbstractPlcConnection.ping(AbstractPlcConnection.java:183)
at org.apache.plc4x.java.spi.messages.DefaultPlcPingRequest.execute(DefaultPlcPingRequest.java:40)
at org.apache.plc4x.java.spi.connection.DefaultNettyPlcConnection.ping(DefaultNettyPlcConnection.java:205)
at org.apache.plc4x.java.modbus.rtu.ModbusRtuPingTest.lambda$0(ModbusRtuPingTest.java:30)
at org.junit.jupiter.api.AssertDoesNotThrow.assertDoesNotThrow(AssertDoesNotThrow.java:71)
... 6 more
The pingAddress attribute of ModbusRtuProtocolLogic seems to have never been assigned, which is different from ModbusTcpProtocolLogic.
What happened?
Execute this code
Then
The
pingAddress
attribute ofModbusRtuProtocolLogic
seems to have never been assigned, which is different fromModbusTcpProtocolLogic
.plc4x/plc4j/drivers/modbus/src/main/java/org/apache/plc4x/java/modbus/rtu/protocol/ModbusRtuProtocolLogic.java
Lines 48 to 54 in b186437
Furthermore, its
ModbusRtuProtocolLogic.ping()
andModbusRtuDriver.canPing()
are both overridden, so I think this is unexpected.plc4x/plc4j/drivers/modbus/src/main/java/org/apache/plc4x/java/modbus/rtu/protocol/ModbusRtuProtocolLogic.java
Lines 61 to 63 in b186437
plc4x/plc4j/drivers/modbus/src/main/java/org/apache/plc4x/java/modbus/rtu/ModbusRtuDriver.java
Lines 100 to 103 in b186437
Additionally,
ModbusAsciiProtocolLogic
also seems to have this issue.Version
v0.12.0, v0.13.0-SNAPSHOT
Programming Languages
Protocols
The text was updated successfully, but these errors were encountered: