Java使用Utgard连接Wincc OPC DA 读取过程中 报错 Improper length UUID:38

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)
  • 解决方法 本机环境JDK13 改为JDK8则好使
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。