Hi everyone,
I'm trying to browse nodes in a Kepware KEPServer (v5.19 build 467 from october 2015).
I had a proof of concept working on milo 0.4.0, but for the production implementation I chose to run with 0.5.1 which was the latest at that time and I'm running into a problem.
Browsing works fine in Milo 0.4.0 via
opcUaClient.getAddressSpace().browse(browseRoot).get()
But when using Milo 0.5.1 via
opcUaClient.getAddressSpace().browseNodes(browseRoot)
It produces the following error:
Caused by: UaException: status=Bad_UnexpectedError, message=java.util.concurrent.ExecutionException: java.lang.NullPointerException
at org.eclipse.milo.opcua.sdk.client.AddressSpace.browseNodes(AddressSpace.java:516)
at org.eclipse.milo.opcua.sdk.client.AddressSpace.browseNodes(AddressSpace.java:501)
... 3 more
Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException
at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)
at org.eclipse.milo.opcua.sdk.client.AddressSpace.browseNodes(AddressSpace.java:514)
... 7 more
Caused by: java.lang.NullPointerException
at org.eclipse.milo.opcua.sdk.client.AddressSpace.newVariableNode(AddressSpace.java:1204)
at org.eclipse.milo.opcua.sdk.client.AddressSpace.lambda$getVariableNodeAsync$4(AddressSpace.java:311)
at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
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.UaStackClient.lambda$deliverResponse$5(UaStackClient.java:256)
at org.eclipse.milo.opcua.stack.core.util.ExecutionQueue$Task.run(ExecutionQueue.java:119)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
The NPE seems to be triggered from this code:
private UaVariableNode newVariableNode(NodeId nodeId, NodeId typeDefinitionId, List<DataValue> attributeValues) {
NodeClass nodeClass = NodeClass.from((Integer) attributeValues.get(1).getValue().getValue());
I'm wondering if I should be doing things in another way, or if there is some incompatibility between this server and the milo 0.5.1 client.
I can just use the 0.4.0 for my production code, but at some point we're going to want to upgrade, so I'd like to understand where the problem lies.
Cheers,
Guy
_______________________________________________