14:18, EET
February 2, 2017
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 ) 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
15:32, EET
April 3, 2012
11:20, EET
February 2, 2017
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.
19:07, EET
Moderators
April 17, 2013
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.
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.comModerators: 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