Topic RSS12:18, EEST
August 13, 2013
OfflineHello,
i received a NullPointerException on the .browse methode in the class AddressSpace.
It occurs when the NodeId is null:
My code:
/**
* Returns a List of ReferenceDescriptions. List only contains references
* of one specified type
* @param addressSpace of the opc-server
* @param nodeId which is parent for the list of referenceDescriptions
* @param reference reference type of the list
* @return a list of ReferenceDescriptions
* @throws ServiceException if browsing fails
* @throws StatusException if browsing fails
*/
public static List getReferenceDescriptions(
final AddressSpace addressSpace, final NodeId nodeId,
final NodeId reference) throws ServiceException, StatusException {
return addressSpace.browse(nodeId, BrowseDirection.Forward, reference,
true, NodeClass.Object, NodeClass.Variable,
NodeClass.ObjectType);
}
The Stacktrace:
java.lang.NullPointerException: nodeId
at com.prosysopc.ua.client.AddressSpace.browse(Unknown Source)
at com.prosysopc.ua.client.AddressSpace.browse(Unknown Source)
at de.spektra.infraview.conformance.OpcUaUtil.getReferenceDescriptions(OpcUaUtil.java:224)
1 Guest(s)

Log In
Register