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
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.commons.lang3.reflect.FieldUtils.getAllFields(Ljava/lang/Class;)[Ljava/lang/reflect/Field;
at org.apache.plc4x.java.spi.configuration.ConfigurationFactory.createConfiguration(ConfigurationFactory.java:85)
at org.apache.plc4x.java.spi.configuration.ConfigurationFactory.createConfiguration(ConfigurationFactory.java:62)
at org.apache.plc4x.java.spi.connection.GeneratedDriverBase.getConnection(GeneratedDriverBase.java:324)
at org.apache.plc4x.java.spi.connection.GeneratedDriverBase.getConnection(GeneratedDriverBase.java:293)
at org.apache.plc4x.java.DefaultPlcDriverManager.getConnection(DefaultPlcDriverManager.java:79)
at com.plc.lib.driver.plc.modbus.ModbusExample.main(ModbusExample.java:35)
Version
0.13.0-SNAPSHOT
Programming Languages
plc4j
plc4go
plc4c
plc4net
Protocols
AB-Ethernet
ADS /AMS
BACnet/IP
CANopen
DeltaV
DF1
EtherNet/IP
Firmata
KNXnet/IP
Modbus
OPC-UA
S7
The text was updated successfully, but these errors were encountered:
It seems that the build is complaining about FieldUtils.getAllFields not existing in your lib. This however is part of commons-lang3 ... could it be that you are explicitly importing commons-lang3 in a version that doesn't have getAllFields? The API documentation says it exists since version 3.2 ... so are you possibly using an older version?
What happened?
String ip = "127.0.0.1";
String port = "503";
// 单元标识符:相当于设备的地址
String unitIdentifier = "1";
String timeout = "5000";
String urlFormat = "modbus-tcp:tcp://{}:{}?unit-identifier={}&request-timeout={}";
// try里面会自动关闭连接
try (PlcConnection plcConnection = PlcDriverManager
.getDefault()
.getConnectionManager()
.getConnection(StringUtils.format(urlFormat, ip, port, unitIdentifier, timeout)))
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.commons.lang3.reflect.FieldUtils.getAllFields(Ljava/lang/Class;)[Ljava/lang/reflect/Field;
at org.apache.plc4x.java.spi.configuration.ConfigurationFactory.createConfiguration(ConfigurationFactory.java:85)
at org.apache.plc4x.java.spi.configuration.ConfigurationFactory.createConfiguration(ConfigurationFactory.java:62)
at org.apache.plc4x.java.spi.connection.GeneratedDriverBase.getConnection(GeneratedDriverBase.java:324)
at org.apache.plc4x.java.spi.connection.GeneratedDriverBase.getConnection(GeneratedDriverBase.java:293)
at org.apache.plc4x.java.DefaultPlcDriverManager.getConnection(DefaultPlcDriverManager.java:79)
at com.plc.lib.driver.plc.modbus.ModbusExample.main(ModbusExample.java:35)
Version
0.13.0-SNAPSHOT
Programming Languages
Protocols
The text was updated successfully, but these errors were encountered: