11:08, EEST
December 6, 2016
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.
12:38, EEST
April 3, 2012
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.
Most Users Ever Online: 1919
Currently Online:
22 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: 729
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
rondawolinski7, Marypof5711, roycedelargie91, kourtneyquisenbe, ellis87832073466, zkxwilliemae, gabriellabachus, Deakin, KTP25Zof, Wojciech KubalaModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1