Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [milo-dev] Problem browsing nodes in Kepware using milo 0.5.x

Kevin,

Thanks for the fast response!
I have replaced the 0.5.1 milo jars in my classpath with 0.5.3-SNAPSHOT versions built locally from that branch (after fixing a linelength issue reported by checkstyle) and it works for me - I can't reproduce the issue anymore.

Cheers,
Guy

On Mon, Oct 19, 2020 at 5:38 PM Kevin Herron <kevinherron@xxxxxxxxx> wrote:
Guy,

Can you verify this works for you before I merge it?

Issue here: https://github.com/eclipse/milo/issues/714
PR here: https://github.com/eclipse/milo/pull/715
Branch here: https://github.com/eclipse/milo/tree/issues/gh714

On Mon, Oct 19, 2020 at 6:25 AM Kevin Herron <kevinherron@xxxxxxxxx> wrote:
Nevermind, I can reproduce this on my own.

The issue seems to be that Kepware will return references to Nodes during browsing that when subsequently read return Bad_NodeIdUnknown for all attributes.

While strange, the client should handle this better than an uncaught NPE. I'm not sure yet what the best approach will be. I don't think it's ideal that the entire `browseNodes` call fails because only some of the referenced Nodes could be created, but the only alternative I can see is to return the ones that could be built and  perhaps log about the failure for those that couldn't.

On Mon, Oct 19, 2020 at 5:28 AM Kevin Herron <kevinherron@xxxxxxxxx> wrote:
Guy,

Does this happen only once your browse reaches a particular Node? Can you share enough code that I can reproduce this?

From your stack trace the best I can tell is that Kepware is returning a null value when the NodeClass attribute for some Node was read, which seems very strange considering that is a required attribute and should never be null.

On Mon, Oct 19, 2020 at 12:31 AM Guy Mahieu <guy.mahieu@xxxxxxxxx> wrote:
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
_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/milo-dev
_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/milo-dev

Back to the top