Avatar

Please consider registering
guest

sp_LogInOut Log In sp_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 RSS sp_TopicIcon
StructureUtils Logging
April 23, 2018
11:08, EEST
Avatar
reinhard
Member
Members
Forum Posts: 12
Member Since:
December 6, 2016
sp_UserOfflineSmall Offline

After having upgraded to Versoin 3.0.0 we notice that our logfiles are flooded with error messages and stack-traces like this:
[..]
ERROR | StructureUtils | Could not call clone to a Cloneable object: [(de) className], fallback: returning the given object
java.lang.NoSuchMethodException: [Lorg.opcfoundation.ua.builtintypes.LocalizedText;.clone()
at java.lang.Class.getMethod(Class.java:1786) ~[?:1.8.0_152]
at com.prosysopc.ua.StructureUtils.clone(SourceFile:41) ~[prosys-opc-ua-java-sdk-client-server-3.0.0-454.jar:?]
at ams.zpmsptkp.opc.model.TK_StandStill.clone(TK_StandStill.java:92) ~[bin/:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_152]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_152]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_152]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_152]
at com.prosysopc.ua.types.opcua.server.BaseVariableTypeNode$1.onDataChange(SourceFile:222) ~[prosys-opc-ua-java-sdk-client-server-3.0.0-454.jar:?]
at com.prosysopc.ua.server.nodes.ServerNode.fireDataChange(SourceFile:786) ~[prosys-opc-ua-java-sdk-client-server-3.0.0-454.jar:?]
at com.prosysopc.ua.server.nodes.ServerNode.dataChange(SourceFile:659) ~[prosys-opc-ua-java-sdk-client-server-3.0.0-454.jar:?]
at com.prosysopc.ua.server.nodes.UaVariableNode.setValue(SourceFile:450) ~[prosys-opc-ua-java-sdk-client-server-3.0.0-454.jar:?]
at com.prosysopc.ua.server.nodes.UaVariableNode.b(SourceFile:577) ~[prosys-opc-ua-java-sdk-client-server-3.0.0-454.jar:?]
at com.prosysopc.ua.server.nodes.UaVariableNode.setValue(SourceFile:459) ~[prosys-opc-ua-java-sdk-client-server-3.0.0-454.jar:?]
at com.prosysopc.ua.types.opcua.server.BaseVariableTypeNode$1.onDataChange(SourceFile:233) ~[prosys-opc-ua-java-sdk-client-server-3.0.0-454.jar:?]
at com.prosysopc.ua.server.nodes.ServerNode.fireDataChange(SourceFile:786) ~[prosys-opc-ua-java-sdk-client-server-3.0.0-454.jar:?]
at com.prosysopc.ua.server.nodes.ServerNode.dataChange(SourceFile:659) ~[prosys-opc-ua-java-sdk-client-server-3.0.0-454.jar:?]
at com.prosysopc.ua.server.nodes.UaVariableNode.setValue(SourceFile:450) ~[prosys-opc-ua-java-sdk-client-server-3.0.0-454.jar:?]
at com.prosysopc.ua.server.nodes.UaVariableNode.b(SourceFile:577) ~[prosys-opc-ua-java-sdk-client-server-3.0.0-454.jar:?]
at com.prosysopc.ua.server.nodes.UaVariableNode.setValue(SourceFile:459) ~[prosys-opc-ua-java-sdk-client-server-3.0.0-454.jar:?]
at com.prosysopc.ua.server.nodes.UaVariableNode.updateValue(SourceFile:953) ~[prosys-opc-ua-java-sdk-client-server-3.0.0-454.jar:?]
at com.prosysopc.ua.server.nodes.CacheVariable.updateValue(SourceFile:87) ~[prosys-opc-ua-java-sdk-client-server-3.0.0-454.jar:?]
at com.prosysopc.ua.server.nodes.UaVariableNode.updateValue(SourceFile:517) ~[prosys-opc-ua-java-sdk-client-server-3.0.0-454.jar:?]
at com.prosysopc.ua.server.nodes.CacheVariable.updateValue(SourceFile:73) ~[prosys-opc-ua-java-sdk-client-server-3.0.0-454.jar:?]
at com.prosysopc.ua.server.nodes.UaVariableNode.setValue(SourceFile:472) ~[prosys-opc-ua-java-sdk-client-server-3.0.0-454.jar:?]
at ams.zpmsptkp.opc.model.server.TK_MachineNodeBase.setStandStills(TK_MachineNodeBase.java:119) ~[bin/:?]
[..]

This originates from the clone-method of a generated Structure class. In this example, StructureUtils.clone is called with a object that does not implement Cloneable (LocalizedText). As StructureUtils.clone seems to fallback to return the object itself when it cannot be cloned, i think a LogLevel of Debug should be sufficient, it must not be ERROR! Or you should change how clone-methods are generated for generated Structure classes.

April 23, 2018
12:38, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

Thank you for noticing this. Actually this seems to be implementation error and can be treated as a bug. Will be fixed for the next release (I can give beta links earlier if needed).

The issue that gives the exception is that java arrays seem to be Cloneable, however seems their .clone method cannot be accessed reflectively, which will give the NoSuchMethodException. And the stacktrace is from trying to clone array of LocalizedText “[(de) className]”. The error log level message is only displayed if the object given is Cloneable, but for some reason it could not be called reflectively. Usually this would indicate some implementation error of clone method (as it is not included in the Cloneable interface).

The fix will be to call MultidimensionalArrayUtils.deepClone instead for all arrays.

April 23, 2018
15:47, EEST
Avatar
reinhard
Member
Members
Forum Posts: 12
Member Since:
December 6, 2016
sp_UserOfflineSmall Offline

Thank you for your answer. We just will upgrade to the next release as soon as this is available.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
22 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

ibrahim: 75

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 684

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6259

Newest Members:

fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com, aytule, rashadbrownrigg, christi10l, ahamad1, Flores Frederick, ellenmoss

Moderators: Jouni Aro: 1009, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1