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
NullPointerException when using Subscriptions
November 30, 2017
14:18, EET
Avatar
clemens.boehler
Member
Members
Forum Posts: 6
Member Since:
February 2, 2017
sp_UserOfflineSmall Offline

Hi everybody,

I am trying to integrate subscriptions in our application. However, I am getting this NullpointerException with the latest Java SDK 2.3.2-781

Exception in thread “PublishRequestQueue-35cd9b7e-eadc-43f5-9299-e6ea06277fc4-0157011E” java.lang.NullPointerException
at com.prosysopc.ua.server.Session.getDiagnosticsManager(Unknown Source)
at com.prosysopc.ua.server.Session.a(Unknown Source)
at com.prosysopc.ua.server.ServiceHandler.fireRequestResponse(Unknown Source)
at com.prosysopc.ua.server.ServiceHandler.validateResponse(Unknown Source)
at com.prosysopc.ua.server.SubscriptionServiceHandler$b.run(Unknown Source)
at java.lang.Thread.run(Thread.java:662)

Is this bug already known (and hopefully fixed as well Smile) because the exception occurs quite frequently. I tried different OPC UA servers (Prosys, Siemens PLC and B&R PLC) and I can reproduce it with all of them.

Could you please have a look at it?

Thanks in advance and knd regards,
Clemens

November 30, 2017
15:32, EET
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

You posted this on our graphical clients forum and asked about SDK, therefore moved to SDK forum.

This is a server side exception, therefore your statement of “I tried different OPC UA servers” does not make sense.

Which client/client SDK did you use and what did you do?

December 11, 2017
11:20, EET
Avatar
clemens.boehler
Member
Members
Forum Posts: 6
Member Since:
February 2, 2017
sp_UserOfflineSmall Offline

Hi,

I am using the Prosys-OPC-UA-Java-SDK-Client-Server-Binary-2.3.2-781.jar and the Opc.Ua.Stack-1.02.337.18.jar.

After connecting to a server, I create a Subscription object

subscription = new Subscription();
subscription.setPublishingEnabled(true);
subscription.setPublishingInterval(publishingInterval, TimeUnit.MILLISECONDS);
subscription.addNotificationListener(listener);

and add MonitoredDataItems by

MonitoredDataItem dataItem = new MonitoredDataItem(item.getNodeId());
subscription.addItem(dataItem);

Finally, I add the subscription to the client. Before closing the connection to the server, I remove all subscriptions and I think this causes the exception.

December 12, 2017
19:07, EET
Avatar
Heikki Tahvanainen
Moderator
Members

Moderators
Forum Posts: 402
Member Since:
April 17, 2013
sp_UserOfflineSmall Offline

Hi Clemens,

Thank you for the information. Indeed, there’s a possible NPE in Session.getDiagnosticsManager() method in the latest release version. As Bjarne already mentioned, this is a server side exception.

Fortunately, this condition can only happen when the client is already disconnecting, so the error situation isn’t really catastrophic. But anyway, this is something that is important to fix.

We have already fixed this to our development version, but the fix is not officially released yet. I’ll send you a download link to the fixed version by email.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
15 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: 681

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com

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