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
"NullPointerException: nodeId" in AddressSpace.getNode()
September 11, 2026
9:12, EEST
Avatar
devaskim
Member
Members
Forum Posts: 8
Member Since:
February 29, 2024
sp_UserOfflineSmall Offline

Hello, team
Have NPE in 4.8.0. Any thougths on that?
======
Here is stacktrace.

java.lang.NullPointerException: nodeId
at com.prosysopc.ua.client.AddressSpace.browse(SourceFile:1862)
at com.prosysopc.ua.client.AddressSpace.browse(SourceFile:367)
at com.prosysopc.ua.client.AddressSpace.readReferences(SourceFile:1404)
at com.prosysopc.ua.client.AddressSpace.getNode(SourceFile:977)
at com.prosysopc.ua.client.AddressSpace.getNode(SourceFile:854)
at
======
The simplified code:

List references = addressSpace().browse(nodeId, BrowseDirection.Forward, NodeId.NULL, true, NodeClass.Variable);
ExpandedNodeId expandedNodeId = references.get(0).getNodeId();
UaNode uaNode = addressSpace().getNode(expandedNodeId);

September 11, 2026
12:45, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1115
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

That version is over 4 years old. Could you please try again with the latest version, 5.8.0?

The .getNode does read the Attributes of the node. In 4.x that also did re-read the NodeId Attribute, with basically assuming it gets the same NodeId back. This was changed during 5.x (around 5.4.0) that the NodeId of an UaNode is final and wont be re-read anymore.

Can you show what client.readAttribute(expandedNodeId, Attributes.NodeId) returns or throws?
The expandedNodeId being the same as what you used for addressSpace().getNode(expandedNodeId). If the result is anything, but the expandedNodeId (in NodeId format that is; depending on things the ExpandedNodeId format could have been with the namespaceuri as well), then that is probably the issue and the server must be fixed. In practice to in this case I would expect a null value with bad status be returned in the DataValue for the theory to be proven. IF this was the case, then 5.8.0 should avoid the issue (but let us know if not), though the server should still be fixed.

Forum Timezone: Europe/Helsinki
Most Users Ever Online: 2206
Currently Online:
Guest(s) 35
Currently Browsing this Page:
5 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 149
rocket science: 128
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 912
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1599
Posts: 6757
Newest Members:
owlsky, estelakirkland9, tanyawang, VandornNogsjessy, quincyhuskey8, itilgabut, Frankliant, wp_admin_bdeca9, wp_service_3d79f8, wp_admin_29d15d
Moderators: Jouni Aro: 1059, Pyry: 1, Petri: 1, Bjarne Boström: 1106, Jimmy Ni: 26, Matti Siponen: 372, Lusetti: 1
Administrators: admin: 1