13:56, EEST
June 27, 2012
I’m using a custom node manager, and I’m seeing this exception when I try to write to an Int32 in my namespace.
I can read the value okay, and when I look at its properties in the client, I see that the data type is Int32 – nodeId is 0:6
This is how I’m creating the reference to the dataType in getReferences:
new NewClxReference(nodeInfo.nodeId,
getNamespaceTable().toExpandedNodeId(nodeInfo.dataTypeId),
Identifiers.HasTypeDefinition));
nodeInfo.dataTypeId is Identifiers.Int32 in this case.
Caused by: java.lang.ClassCastException: com.prosysopc.ua.server.nodes.UaExternalNodeImpl cannot be cast to com.prosysopc.ua.nodes.UaDataType
at com.prosysopc.ua.DataTypeConverter.a(Unknown Source)
at com.prosysopc.ua.DataTypeConverter.a(Unknown Source)
at com.prosysopc.ua.DataTypeConverter.(Unknown Source)
at com.prosysopc.ua.server.NodeManagerRoot.getDataTypeConverter(Unknown Source)
at com.prosysopc.ua.server.ServiceManagerBase.dataTypeEquals(Unknown Source)
at com.prosysopc.ua.server.IoManager.checkDataType(Unknown Source)
at com.prosysopc.ua.server.IoManager.writeAttribute(Unknown Source)
at com.oldi.opcuaserver.NewClxNodeManager$NewClxIoManager.writeAttribute(NewClxNodeManager.java:1016)
at com.prosysopc.ua.server.NodeManagerTable.writeAttribute(Unknown Source)
at com.prosysopc.ua.server.AttributeServiceHandler.writeAttribute(Unknown Source)
at com.prosysopc.ua.server.AttributeServiceHandler.write(Unknown Source)
at com.prosysopc.ua.server.AttributeServiceHandler.onWrite(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
… 11 more
14:24, EEST
December 21, 2011
Have you defined a custom data type in your address space? It looks like there is a HasSubtype reference to an UaExternalNode from one of the DataType nodes.
If yes, what kind of reference is it?
The DataTypeConverter is not expecting such, but I believe it should be able to handle that better anyway.
17:03, EEST
December 21, 2011
18:32, EEST
June 27, 2012
Maybe there’s something I’m misunderstanding here, but AFAIK I’m not creating any node objects. I’m implementing a custom node manager, and my understanding was that in that case, the node objects themselves aren’t actually created – my node manager just responds to requests for information about them. When asked for the various node attributes, values, or their references my code seems to be returning the right stuff, but I don’t see anywhere that I would create/return a UaDataType object.
21:32, EEST
December 21, 2011
OK, yes that explains it, of course: external node is used for nodes that are not defined as nodes in the . So far all Data Types have been defined with nodes, and that is also expected in the DataTypeConverter. I will figure how this situation should be handled. Version 1.4.4 is about to be released next week and this might go in there as well. Send an email to uajava-support@prosysopc.com, if you wish to verify it with a beta before the release.
What kind of types do you have, i.e. what’s their super type(s)?
Alternative is that you define the DataType nodes with UaDataTypes.
6:45, EEST
December 21, 2011
OK, the structure types will not support “automatic” conversions anyway with the DataTypeConverter – and probably will not need such. So I suppose it is valid to define the types in your own node manager. I will have made the converter to omit non-UaDataType nodes, instead of throwing an exception.
You would have two options to define the types with UaDataType nodes, although your other data is custom nodes.
1. You can define another NodeManagerUaNode in which you add the type nodes, aside your custom node manager.
2. You can use a “hybrid” node manager that can include some UaNode-nodes and provide the rest as your “custom nodes”. This should be a sub class of NodeManagerUaNode so that it can handle UaNodes, but you could use the same way to provide your custom nodes. You would need to modify the overridden methods of the “big node manager” to call the super-methods, in case you do not provide data for the requested node yourself.
Most Users Ever Online: 1919
Currently Online:
23 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: 738
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
doylenewbery, mickey21654, donnyredmond08, keesha4235, cheribruce, candacekolb4, Garmcrypto7Zof, calebhardison, susannahdingle7, inilarythikibiaModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1