問題タブ [milo]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
1 に答える
1178 参照

java - Eclipse milo: データを読み取ろうとするとセッションが閉じられました

外部 OPC UA サーバーがあり、そこからデータを読み取りたいと考えています。ユーザー名とパスワード認証を使用するため、クライアントは次のように初期化されます。

クライアントの要求は次のとおりです。

クライアントを初期化してサーバーに接続した後、メイン メソッドからこのリクエストを呼び出します。

ただし、このコードは機能しません (サーバーから情報を読み取ろうとすると、セッションが閉じられます)。次の出力が得られます。

2018-04-12 17:43:27,765 DEBUG --- [ua-netty-event-loop-0] リサイクラー: -Dio.netty.recycler.maxCapacity.default: 262144
2018-04-12 17:43:27,777 DEBUG --- [ua-netty-event-loop-0] UaTcpClientAcknowledgeHandler : channel=[id: 0xfd9519e3, L:/172.20.100.54:55805 - R:/172.20.100.135:4840] で Hello メッセージを送信しました。
2018-04-12 17:43:27,786 DEBUG --- [ua-netty-event-loop-0] UaTcpClientAcknowledgeHandler : チャネルで受信確認メッセージ = [id: 0xfd9519e3、L:/172.20.100.54:55805 - R:/ 172.20.100.135:4840]。
2018-04-12 17:43:27,793 DEBUG --- [ua-netty-event-loop-0] UaTcpClientMessageHandler : +5 秒にスケジュールされた OpenSecureChannel タイムアウト
2018-04-12 17:43:27,946 DEBUG --- [ua-shared-pool-0] UaTcpClientMessageHandler : OpenSecureChannelRequest を送信しました (問題、id=0、currentToken=-1、previousToken=-1)。
2018-04-12 17:43:27,951 DEBUG --- [ua-netty-event-loop-0] UaTcpClientMessageHandler : OpenSecureChannel タイムアウトがキャンセルされました
2018-04-12 17:43:27,961 DEBUG --- [ua-shared-pool -0] UaTcpClientMessageHandler : OpenSecureChannelResponse を受け取りました。
2018-04-12 17:43:27,967 DEBUG --- [ua-shared-pool-0] UaTcpClientMessageHandler : SecureChannel id=1698234671、currentTokenId=1、previousTokenId=-1、lifetime=3600000ms、createdAt=DateTime{utcTime=131680285857690000 , javaDate=Thu Apr 12 19:43:05 CEST 2018}
2018-04-12 17:43:27,968 DEBUG --- [ua-netty-event-loop-0] UaTcpClientMessageHandler : ハンドシェイクが完了する前にキューに入れられた 0 メッセージ。今送信中。
2018-04-12 17:43:27,968 DEBUG --- [ua-shared-pool-1] ClientChannelManager: チャネルのブートストラップが成功しました: localAddress=/172.20.100.54:55805, remoteAddress=/172.20.100.135:
4840 2018-04- 12 17:43:27,996 DEBUG --- [ua-shared-pool-0] ClientChannelManager: disconnect(), currentState=Connected
2018-04-12 17:43:27,997 DEBUG --- [ua-shared-pool-1 ] ClientChannelManager : CloseSecureChannelRequest を送信しています...
2018-04-12 17:43:28,000 DEBUG --- [ua-netty-event-loop-0] ClientChannelManager : channelInactive()、切断完了
2018-04-12 17:43:28,001 DEBUG --- [ua-netty-event-loop-0] ClientChannelManager : 切断が完了し、状態がアイドルに設定されました
2018-04-12 17:43:28,011 INFO --- [main ] OpcUaClient : Eclipse Milo OPC UA スタック バージョン: 0.2.1
2018-04-12 17:43:28,011 INFO --- [メイン] OpcUaClient : Eclipse Milo OPC UA クライアント SDK バージョン: 0.2.1
2018-04-12 17: 43:28,056 DEBUG --- [メイン] OpcUaClient : ServiceFaultListener を追加しました: org.eclipse.milo.opcua.sdk.client.session.SessionFsm$FaultListener@46d59067
2018-04-12 17:43:28,066 DEBUG --- [メイン] OpcUaClient : SessionActivityListener を追加しました: org.eclipse.milo.opcua.sdk.client.subscriptions.OpcUaSubscriptionManager$1@78452606
2018-04-12 17:43:28,189 INFO --- [main] CommunicationMain: 同期 TestStackRequest NodeId=NodeId{ns=6, id=::opcua:opcData.outGoing.basic.cycleStep}
を送信中 2018-04-12 17 :43:28,189 DEBUG --- [main] ClientChannelManager : connect(), currentState=NotConnected
2018-04-12 17:43:28,190 DEBUG --- [main] ClientChannelManager : connect() while NotConnected
java.lang.Exception
at org.eclipse.milo.opcua.stack.client.ClientChannelManager.connect(ClientChannelManager.java:67)
at org.eclipse.milo.opcua.stack.client.UaTcpStackClient.connect(UaTcpStackClient.java:127)
at org.eclipse. com.mycompany.opcua.participants.MyClient.connect(MyClient.java:147)
の milo.opcua.sdk.client.OpcUaClient.connect(OpcUaClient.java:313)
com.mycompany.opcua.participants.CommunicationMain.testClient(CommunicationMain.java:69)
で com.mycompany.opcua.participants.CommunicationMain.main(CommunicationMain.java:51)
2018-04-12 17:43:28,190 DEBUG - -- [main] MyClient : リクエスト
2018-04-12 17:43:28,197 DEBUG を送信中 --- [ua-netty-event-loop-1] UaTcpClientAcknowledgeHandler : channel=[id: 0xd9b3f832, L:/ 172.20.100.54:55806 - R:/172.20.100.135:4840]。
2018-04-12 17:43:28,204 DEBUG --- [ua-netty-event-loop-1] UaTcpClientAcknowledgeHandler : channel=[id: 0xd9b3f832, L:/172.20.100.54:55806 - R:/ 172.20.100.135:4840]。
2018-04-12 17:43:28,205 DEBUG --- [ua-netty-event-loop-1] UaTcpClientMessageHandler : +5 秒にスケジュールされた OpenSecureChannel タイムアウト
2018-04-12 17:43:28,205 DEBUG --- [ua- shared-pool-0] UaTcpClientMessageHandler : OpenSecureChannelRequest を送信しました (問題、id=0、currentToken=-1、previousToken=-1)。
2018-04-12 17:43:28,208 DEBUG --- [ua-netty-event-loop-1] UaTcpClientMessageHandler : OpenSecureChannel タイムアウトがキャンセルされました
2018-04-12 17:43:28,208 DEBUG --- [ua-shared-pool -0] UaTcpClientMessageHandler : OpenSecureChannelResponse を受け取りました。
2018-04-12 17:43:28,209 DEBUG --- [ua-shared-pool-0] UaTcpClientMessageHandler : SecureChannel id=1698234672、currentTokenId=1、previousTokenId=-1、lifetime=3600000ms、createdAt=DateTime{utcTime=131680285860260000 , javaDate=Thu Apr 12 19:43:06 CEST 2018}
2018-04-12 17:43:28,209 DEBUG --- [ua-netty-event-loop-1] UaTcpClientMessageHandler : ハンドシェイクが完了する前にキューに入れられた 0 メッセージ; 今送信中。
2018-04-12 17:43:28,209 DEBUG --- [ua-shared-pool-1] ClientChannelManager: チャネルのブートストラップが成功しました: localAddress=/172.20.100.54:55806, remoteAddress=/172.20.100.135:
4840 2018-04- 12 17:43:28,210 DEBUG --- [ua-shared-pool-0] SessionFsm: S(非アクティブ) x E(CreateSessionEvent) = S'(作成中)
スレッド「メイン」での例外 java.util.concurrent.ExecutionException: UaException: status=Bad_SessionClosed, message=クライアントによってセッションが閉じられました。
java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)2018-04-12 17:43:28,212 DEBUG --- [ua-shared-pool-1] SessionFsm: CreateSessionRequest を送信しています.. .

java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999)
com.mycompany.opcua.participants.CommunicationMain.testClient(CommunicationMain.java:70)
com.mycompany.opcua.participants.CommunicationMain .main(CommunicationMain.java:51)
原因: UaException: status=Bad_SessionClosed, message=クライアントによってセッションが閉じられました。
org.eclipse.milo.opcua.stack.core.util.FutureUtils.failedUaFuture(FutureUtils.java:100)
で org.eclipse.milo.opcua.stack.core.util.FutureUtils.failedUaFuture(FutureUtils.java:88) で
org.eclipse.milo.opcua.sdk.client.session.states.Inactive.(Inactive.java:28)
で org.eclipse.milo.opcua.sdk.client.session.SessionFsm.(SessionFsm.java:69) で
org.eclipse.milo.opcua.sdk.client.OpcUaClient.(OpcUaClient.java:159)2018-04-12 17:43:28,212 INFO --- [NonceUtilSecureRandom] NonceUtil : 0ms でシードされた SecureRandom。

com.mycompany.opcua.participants.MyClient.(MyClient.java:112)
で com.mycompany.opcua.participants.CommunicationMain.testClient(CommunicationMain.java:60)
... 1 つ以上

OPC UA ライブラリとして Eclipse milo 0.2.1 を使用しています。

この問題の原因とその修正方法を教えてください。これに関連する競合状態になることはありますか?

他のクライアント (UaExpert) を使用して同じサーバーに接続できます。

前もって感謝します。