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
Java SDK Cast Error
December 1, 2016
19:00, EET
Avatar
dhooper
Connecticut
Member
Members
Forum Posts: 6
Member Since:
December 1, 2016
sp_UserOfflineSmall Offline

Hello,

I am getting an unknown error in our client built on top of the Prosys Java stack. We are attempting to add nodes to a subscription, so we do the following:

for(SubscriptionNode node : nodesToAdd) {

AbstractMonitoredItemFactory factory =
node.isAlarmEvent() ? new MonitoredEventItemFactory() : new MonitoredDataItemFactory();

// unserialize our node id
NodeId nodeId = NodeUtilities.unserializeNodeId(node.getNodeId(), subscription.getClient(), “Subscriptions”);

// create the new monitored item
MonitoredItem monitoredItem = factory.createMonitoredItem(
nodeId, node.getAttribute(), node.getDeadbandType(),
node.getDeadbandValue(), node.getPublishingInterval()
);

if(subscription.getNotificationListeners().length == 0) {
subscription.addNotificationListener(
new EmpriseSubscriptionListener(serverId, serverDescription, serverIp));
}

// add it to the subscription
try {
MonitoredItemCreateResult result = subscription.addItem(monitoredItem);
node.setMonitoredItemId(result.getMonitoredItemId());
node.setNodeStatus(“Complete”);
node.setLastOperation(“Subscribed”);
} catch (ServiceException | StatusException e) {
log.error(“Subscriptions : {}@{} : Unable to add node- {} to subscription {}”,
serverDescription, serverIp, nodeId, subscription, e);
node.setNodeStatus(“Error”);
}
}
}

However, upon reaching “MonitoredItemCreateResult result = subscription.addItem(monitoredItem);”, we get the error:
java.lang.ClassCastException: org.opcfoundation.ua.core.DataChangeFilter cannot be cast to org.opcfoundation.ua.core.MonitoringFilterResult

I realize this has to do with the OPC UA stack, but this error is generated in com.prosysopc.ua.client.Subscription.createMonitoredItems. Does anyone know what might cause this? We are using KepServerEx 6 and UAGateway for in-house simulations. We recently upgraded to KepServerEx 6 from 5, so that could be a source of the problem, but if someone sees something that can be done programatically, locally, that would be a huge help.

December 2, 2016
11:03, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1010
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

We’ve just got the same report from another customer using KepServerEx. And it seems it has a bug that it is returning the DataChangeFilter back in the response message instead of a MonitoringFilterResult as defined by the OPC UA Specification. I suggest that you contact Kepware about this issue in their server.

December 2, 2016
20:42, EET
Avatar
dhooper
Connecticut
Member
Members
Forum Posts: 6
Member Since:
December 1, 2016
sp_UserOfflineSmall Offline

Thank you for the reply and help. I will reach out to Kepware now, and if they have a solution, I will post it here for anyone interested.

December 14, 2016
15:53, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1010
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

We just got a confirmation from Kepware that this is now fixed and a patch should be available. Please contact Kepware support to get the patch.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
18 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 682

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

digitechroshni, LouieWreve, Kickbiche, karrimacvitie5, graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma

Moderators: Jouni Aro: 1010, 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