まず第一に、私は OPCUA の初心者です。:)
Milo クライアントをサーバーに接続しようとしていますが、何が問題なのかよくわかりません。サンプル クライアントとサーバーは一緒に問題なく動作しますが、クライアント サンプルをパブリック OPC-UA-Test-Server の 1 つに接続しようとすると、次の例外が発生します。
15:48:34.729 [ua-netty-event-loop-0] DEBUG org.eclipse.milo.opcua.stack.client.handlers.UaTcpClientAcknowledgeHandler - channel=[id: 0xc22800c2, L:/10.22.19.217 で Hello メッセージを送信しました:58947 - R:opcua.demo-this.com/52.233.134.134:51210]。15:48:34.729 [ua-netty-event-loop-0] WARN io.netty.channel.DefaultChannelPipeline - exceptionCaught() イベントが発生し、パイプラインの末尾に到達しました。これは通常、パイプラインの最後のハンドラーが例外を処理しなかったことを意味します。java.io.IOException: 既存の接続が、sun.nio.ch.SocketDispatcher.read0(Native Method) at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43) at sun のリモート ホストによって強制的に閉じられました。 nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) で sun.nio.ch.IOUtil.read(IOUtil.java:192) で sun.nio.ch.SocketChannelImpl。
opc.tcp://opcua.demo-this.com:51210/UA/SampleServer
サンプルコードを取得し、証明書/キーペアを削除し、公開サーバーは承認を必要としないため、URL を次のように変更しました。
SecurityPolicy securityPolicy = clientExample.getSecurityPolicy();
EndpointDescription[] endpoints = UaTcpStackClient.getEndpoints("opc.tcp://opcua.demo-this.com:51210/UA/SampleServer").get();
EndpointDescription endpoint = Arrays.stream(endpoints)
.filter(e -> e.getSecurityPolicyUri().equals(securityPolicy.getSecurityPolicyUri()))
.findFirst().orElseThrow(() -> new Exception("no desired endpoints returned"));
logger.info("Using endpoint: {} [{}]", endpoint.getEndpointUrl(), securityPolicy);
loader.load();
OpcUaClientConfig config = OpcUaClientConfig.builder()
.setApplicationName(LocalizedText.english("eclipse milo opc-ua client"))
.setApplicationUri("urn:eclipse:milo:examples:client")
//.setCertificate(loader.getClientCertificate())
//.setKeyPair(loader.getClientKeyPair())
.setEndpoint(endpoint)
.setIdentityProvider(clientExample.getIdentityProvider())
.setRequestTimeout(uint(5000))
.build();
return new OpcUaClient(config);
私は何が欠けていますか?
事前にご挨拶と感謝:)