9:23, EET
January 30, 2014
Hi,
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
Hi,
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/OPCFoundation/UA-Java/issues/18
However, it is also true that the server in this case is not working according to specification.
Br,
Heikki Tahvanainen
Most Users Ever Online: 1919
Currently Online:
15 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 730
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
rickykennion, PromotionToold, HypromeImpupe, toneylapham544, rondawolinski7, Marypof5711, roycedelargie91, kourtneyquisenbe, ellis87832073466, zkxwilliemaeModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1