Avatar
Please consider registering
guest
sp_LogInOut Log Insp_Registration Register
Register | Lost password?
Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Feed Topic RSSsp_TopicIcon
"TcpConnection/Read" java.lang.IllegalArgumentException
January 21, 2016
9:23, EET
Avatar
gjevremovic
Member
Members
Forum Posts: 49
Member Since:
January 30, 2014
sp_UserOfflineSmall Offline

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

January 21, 2016
13:31, EET
Avatar
Heikki Tahvanainen
Member
Members
Forum Posts: 402
Member Since:
April 17, 2013
sp_UserOfflineSmall Offline

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/OPCFoundati…../issues/18

However, it is also true that the server in this case is not working according to specification.

Br,
Heikki Tahvanainen

Forum Timezone: Europe/Helsinki
Most Users Ever Online: 1919
Currently Online:
Guest(s) 93
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 100
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 773
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1558
Posts: 6567
Newest Members:
aracelyhaley4, raphaelschonell, Ashmag, kathyreimann56, brittanylemos, dorthycundiff76, PromotionToold, CHHinrichs, rodricklienhop, jose_Wanderlei
Moderators: Jouni Aro: 1039, Pyry: 1, Petri: 1, Bjarne Boström: 1054, Jimmy Ni: 26, Matti Siponen: 359, Lusetti: 0
Administrators: admin: 1