2017-04-25 2 views
0

まずはOPCUAの初心者です。 :)ミロ:(公開)OPC-UA-Serverに接続

私はMiloクライアントをサーバーに接続しようとしていますが、何がうまくいかないのか分かりません。サンプルクライアントとサーバーの作業罰金一緒に、私は公共のOPC-UA-TEST-サーバの1つを使用してクライアントのサンプルを接続しようとすると、私はこれらの例外を取得:

15:48:34.729 [UA-ネッティー-event-loop-0] DEBUG org.eclipse.milo.opcua.stack.client.handlers.UaTcpClientAcknowledgeHandler - チャネル上でHelloメッセージが送信されました= [id:0xc22800c2、L:/10.22.19.217: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(ネイティブメソッド) sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43) (IOUtil.java:223)at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)at sun.nio.ch.IOUtil.read(IOUtil.java:192)at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl。 io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:221) io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:898) io.netty.channelで で で380):Javaの。 socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:242) io.netty.channel.nio.AbstractNioByteChannel $ NioByteUnsafe.read(AbstractNioByteChannel.java:119)で でio.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:528) io.nettyで。 io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:399)io.netty.channel.nio.NioEventLoop.runで でchannel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:485) (NioEventLoop .java:371)at io.netty.util.concurrent.SingleThreadEventExecutor $ 2.run(SingleThreadEventExecutor.java:112) at java.lang.Thread.run(Thread.java:745)15:48:39.612 [ForkJoinPool .commonPool-worker-1] DEBUG org.ecl - ipse.milo.opcua.stack.client.ClientChannelManagerチャンネル ブートストラップに失敗しました: org.eclipse.milo.opcua.stack.core.UaExceptionを確認するために待機中にタイムアウト: を待ってタイムアウトし org.eclipse.miloで認めます.opcua.stack.client.handlers.UaTcpClientAcknowledgeHandler.lambda $ startHelloTimeout $ 4(UaTcpClientAcknowledgeHandler.java:156) at org.eclipse.milo.opcua.stack.client.handlers.UaTcpClientAcknowledgeHandler $$ Lambda $ 27/469017260.run(不明0123で io.netty.util.HashedWheelTimer $ HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:655) で io.netty.util.HashedWheelTimer $ HashedWheelTimeout.expire(HashedWheelTimer.java:581) で ソース)io.netty.util.HashedWheelTimer $ Worker.run(HashedWheelTimer.java:367) java.lang.Thread.run(Thread.java:745)15:48:39.613 [main] ERROR org.eclipse.milo .examples.client.ClientExampleRunner - 実行中のエラー 例:UaException:status = Bad_Timeout、message =タイムアウト待ち 応答ありjava.util.concurrent.ExecutionException:UaException: status = Bad_Timeout、message =java。 org.eclipse.milo.examples.client.ClientExampleRunner.createClientでjava.util.concurrent.CompletableFuture.get(CompletableFuture.java:1887) ( でutil.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357) ClientExampleRunner.java:56) でorg.eclipse.milo.examples.client.ClientExampleRunner.run(ClientExampleRunner.java:103) org.eclipse.milo.examples.client.BrowseExample.main(BrowseExample.javaで: 40)によって引き起こさ :org.eclipse.milo.opcua.stack.core.UaException: org.eclipse.milo.opcua.stack.client.handlers.UaTcpClientAcknowledgeHandler.lambda $ startHelloTimeout $ 4の(UaTcpClientAcknowledgeHandlerでアクノリッジを待っ をタイムアウトしました.java : io.netty.util.HashedWheelTimer $ HashedWheelTimeout.expire(HashedWheelTimerで org.eclipse.milo.opcua.stack.client.handlers.UaTcpClientAcknowledgeHandler $$ラムダ$ 27/469017260.run(不明 出典)で156) 。 Javaの:581) io.netty.util.HashedWheelTimer $ HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:655) で io.netty.util.HashedWheelTimer $ Worker.run(HashedWheelTimer.java:367)は、Javaで で。スレッドからの2つのスレッドローカルバッファ:ua-netty(スレッドからの2つのスレッドローカルバッファ):lang.Thread.run(Thread.java:745)15:48:42.842 [threadDeathWatcher-2-1] DEBUG io.netty.buffer.PoolThreadCache - 解放 -event-loop-0

私は、サンプルコードを取って、証明書/鍵ペアを削除し、公開サーバが認証を必要としないので、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); 

私は何をしないのですか?事前に

ご挨拶と感謝:)そのスタックトレースに埋もれ

答えて

0

が本当の問題である:UaException: timed out waiting for acknowledge

ファイアウォールやネットワークの設定によってブロックされている可能性があります。または、サーバーが返信しなかった可能性もありますが、クライアントはHelloに応答してAcknowledgeメッセージを受信しなかった可能性があります。

FWIWでは、公開サーバに対して問題なしでReadExampleを実行できます。 ReadExampleでは、私はgetSecurityPolicy()を上書きし、SecurityPolicy.Noneを返し、ちょうど終点URLを置き換えたClientExampleRunnerになりました。

+0

さて、ファイアウォールが問題のようでした。私は他のクライアント(Integration ObjectsとProsys OPC UAクライアントでテスト済み)とサンプルサーバーに接続できるので、なぜか分かりませんが、 – lukas

関連する問題