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: 1032
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
Member
Members
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: 1919

Currently Online:
20 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: 730

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1529

Posts: 6471

Newest Members:

toneylapham544, rondawolinski7, Marypof5711, roycedelargie91, kourtneyquisenbe, ellis87832073466, zkxwilliemae, gabriellabachus, Deakin, KTP25Zof

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0

Administrators: admin: 1