Java使用Utgard连接Wincc OPC DA 读取过程中 报错 Improper length UUID:
- 当时情况
程序跑着跑着IdentifierFactory.createUniqueIdentifier().toHexString()
生成的UUID超出32位
导致GUIDUtil
类中的guidStringFromHexString
方法抛出异常
public static String guidStringFromHexString(String hexString) {
if (32 != hexString.length()) {
throw new IllegalArgumentException("Improper length UUID:" + hexString.length());
} else {
- 错误信息
Improper length UUID:
Exception in thread "jI_ShutdownHook" java.lang.IllegalArgumentException: Improper length UUID:37
at com.iwombat.util.GUIDUtil.guidStringFromHexString(GUIDUtil.java:57)
at org.jinterop.dcom.core.JIOrpcThis.<init>(JIOrpcThis.java:51)
at org.jinterop.dcom.core.JICallBuilder.write(JICallBuilder.java:848)
at ndr.NdrObject.encode(NdrObject.java:15)
at rpc.ConnectionOrientedEndpoint.call(ConnectionOrientedEndpoint.java:92)
at rpc.Stub.call(Stub.java:112)
at org.jinterop.dcom.core.JIComServer.call(JIComServer.java:870)
at org.jinterop.dcom.core.JIComServer.call(JIComServer.java:825)
at org.jinterop.dcom.core.JIComServer.addRef_ReleaseRef(JIComServer.java:909)
at org.jinterop.dcom.core.JISession.releaseRefs(JISession.java:759)
at org.jinterop.dcom.core.JISession.destroySession(JISession.java:549)
at org.jinterop.dcom.core.JISession$2.run(JISession.java:229)
at java.base/java.lang.Thread.run(Thread.java:830)