我使用ReadNodeExample
类来尝试获取 Kepware UA 服务器的节点信息。一切都很好,除了 BuildInfo,我得到以下异常:
19:00:32.723 [main] ERROR ClientExampleRunner - Error running client example: UaException: status=Bad_NotFound, message=A requested item was not found or a search operation ended without success.
java.util.concurrent.ExecutionException: UaException: status=Bad_NotFound, message=A requested item was not found or a search operation ended without success.
at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)
at ReadNodeExample.run(ReadNodeExample.java:52)
at ClientExampleRunner.run(ClientExampleRunner.java:88)
at ReadNodeExample.main(ReadNodeExample.java:22)
Caused by: org.eclipse.milo.opcua.stack.core.UaException: status=Bad_NotFound, description=A requested item was not found or a search operation ended without success.
at org.eclipse.milo.opcua.stack.core.util.FutureUtils.failedUaFuture(FutureUtils.java:99)
at org.eclipse.milo.opcua.stack.core.util.FutureUtils.failedUaFuture(FutureUtils.java:87)
at org.eclipse.milo.opcua.sdk.client.nodes.UaVariableNode.lambda$getTypeDefinition$6(UaVariableNode.java:114)
at java.util.concurrent.CompletableFuture.uniCompose(CompletableFuture.java:952)
at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:926)
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1962)
at org.eclipse.milo.opcua.stack.client.UaTcpStackClient.lambda$receiveResponse$13(UaTcpStackClient.java:294)
at org.eclipse.milo.opcua.stack.core.util.ExecutionQueue$PollAndExecute.run(ExecutionQueue.java:107)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
这是 full 的结果serverStatus
:
19:00:31.549 [main] INFO ReadNodeExample - ServerStatus=ServerStatusDataType{StartTime=DateTime{utcTime=131455372857187500, javaDate=Wed Jul 26 18:08:05 CST 2017}, CurrentTime=DateTime{utcTime=131455404299062500, javaDate=Wed Jul 26 19:00:29 CST 2017}, State=Running, BuildInfo=BuildInfo{ProductUri=urn:WIN-S8JCN9R7PFA:Kepware.KEPServerEX.V6:UA%20Server, ManufacturerName=Kepware, ProductName=KEPServerEX, SoftwareVersion=6.2, BuildNumber=460, BuildDate=DateTime{utcTime=131433109160000000, javaDate=Fri Jun 30 23:41:56 CST 2017}}, SecondsTillShutdown=0, ShutdownReason=LocalizedText{text=null, locale=null}}
我不太确定问题是由于 Kepware 还是 milo 客户端本身造成的。