Topic RSS9:23, EET
January 30, 2014
OfflineHi,
When try to read node with::
UnsignedInteger[] attribs = { Attributes.Value, Attributes.DataType, Attributes.DisplayName, Attributes.BrowseName };
DataValue[] value = uaClient.readAttributes(nodeId, attribs);
I am receiving next exception:
20.01.2016 15:43:23,174 DEBUG OpcUaServerBrowser.dumpOpcUaAddressSpace – Reference Description: parent Objects Organizes node 23
Exception in thread “TcpConnection/Read” java.lang.IllegalArgumentException: Variant cannot be org.opcfoundation.ua.builtintypes.Variant
at org.opcfoundation.ua.builtintypes.Variant.(Unknown Source)
at org.opcfoundation.ua.encoding.binary.BinaryDecoder.getVariant(Unknown Source)
at org.opcfoundation.ua.encoding.binary.BinaryDecoder.getDataValue(Unknown Source)
at org.opcfoundation.ua.encoding.binary.BinaryDecoder.getDataValueArray(Unknown Source)
at org.opcfoundation.ua.core.EncodeableSerializer$121.getEncodeable(Unknown Source)
at org.opcfoundation.ua.encoding.utils.AbstractSerializer.getEncodeable(Unknown Source)
at org.opcfoundation.ua.encoding.utils.SerializerComposition.getEncodeable(Unknown Source)
at org.opcfoundation.ua.encoding.binary.BinaryDecoder.getMessage(Unknown Source)
at org.opcfoundation.ua.transport.tcp.io.TcpConnection$ReadThread.run(Unknown Source)
I know that in this case the problem is on server side. Something is wrong with this node which I try to read. With UaExpert I am receiving:
Read attributes of node ‘NS1|Numeric|123’ failed [ret = BadEncodingError].
My problem is that I want to make my client more robust to skip this problematic node and to continue with browsing other nodes. I tried to catch this exception but looks it is impossible to catch as it is thrown in foundation lib.
It looks foundation has a bug as this IllegalArgumentException isn’t handled.
Could you please post your comment?
BR
Goran
PS
Opc.Ua.Stack-1.02.337.4
Prosys-OPC-UA-Java-SDK-Client-Binary-2.2.0-552
13:31, EET
April 17, 2013
OfflineHi,
That is impossible to catch indeed. This behaviour is probably something that needs to be fixed in the stack. ReadThread.run should probably catch all RuntimeExceptions (or Exceptions). I opened an issue for this at the OPC Foundation Java Stack Github page: https://github.com/OPCFoundati…../issues/18
However, it is also true that the server in this case is not working according to specification.
Br,
Heikki Tahvanainen
1 Guest(s)

Log In
Register