使用Kepware UA服务器获取BuildInfo的UaException

时间:2017-07-26 11:11:04

标签: milo

我使用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)

这是完整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客户端本身。

1 个答案:

答案 0 :(得分:0)

这有点复杂,但问题是Kepware的BuildInfo节点没有指向HasTypeDefinition VariableType的必需BuildInfoType引用。