Avatar
Please consider registering
guest
sp_LogInOut Log Insp_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 RSSsp_TopicIcon
TcpConnection/Read: Uncaught ava.lang.NullPointerException
May 7, 2025
17:53, EEST
Avatar
Manfred Hausmann
Member
Members
Forum Posts: 21
Member Since:
September 21, 2018
sp_UserOfflineSmall Offline

Hi,
in our application we offer the possibility to scan the local network for available OPC servers.
While scanning we’ve caught the following exception:
null thread: TcpConnection/Read
java.lang.NullPointerException
at com.prosysopc.ua.stack.utils.TimerUtil.schedule(SourceFile:112)
at com.prosysopc.ua.stack.transport.tcp.io.SecureChannelTcp.d(SourceFile:1304)
at com.prosysopc.ua.stack.transport.tcp.io.SecureChannelTcp.onClosed(SourceFile:674)
at com.prosysopc.ua.stack.transport.tcp.io.TcpConnection.a(SourceFile:1835)
at com.prosysopc.ua.stack.transport.tcp.io.TcpConnection.a(SourceFile:139)
at com.prosysopc.ua.stack.transport.tcp.io.TcpConnection$b.run(SourceFile:855)

The follwing is logged by prosys:
com.prosysopc.ua.stack.utils.StackUtils: Uncaught Exception in Thread: Thread[OPC-UA-Stack-Blocking-Work-Executor-54,6,main] java.lang.NullPointerException

When closing the Tcp connection, a problem seems to occur at another protocol level (SecureConnection). It seems that an attempt is made to start a TimerTask on a non-existent timer.

Questions
– Is this a known problem?
– Why is neither an UncaughtExceptionHandler installed nor are all RuntimeExceptions and Errors caught in the TcpConnection.ReadThread?
– Is there a workaround?

Best regards,
Manfred

May 8, 2025
11:48, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1077
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

We are aware of a cosmetic-only-NPE scenario due to a potential race-condition when the connection closes. This could be the same as https://forum.prosysopc.com/fo…..mx-is-null or the root cause could be the same.

Did your case result in something else than a cosmetic problem?

May 12, 2025
11:56, EEST
Avatar
Manfred Hausmann
Member
Members
Forum Posts: 21
Member Since:
September 21, 2018
sp_UserOfflineSmall Offline

Hi Bjarne,

for us, this is not just a cosmetic problem.
A DefaultExceptionHandler is registered in our application.
The DefaultExceptionHandler catches all exceptions from threads that do not have an exception handler.
All exceptions that are caught in the DefaultExceptionHandler result in an alarm.
Filtering out exceptions from the TcpConnection/Read thread could be done using a heuristic, but that would not be very nice.

Best regards,
Manfred

May 12, 2025
16:17, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1077
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

I’ll try to increase priority on fixing this, we can send a beta when done.

May 12, 2025
18:50, EEST
Avatar
Manfred Hausmann
Member
Members
Forum Posts: 21
Member Since:
September 21, 2018
sp_UserOfflineSmall Offline

That would be very nice!

Thanks and best regards,
Manfred

May 15, 2025
14:46, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1077
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

I’ll note that now our beta should include a workaround; you should have received a link via email. Note that since we now have a proper ticking system for the mails, the sender is different from the old one. The sender should be jira@prosysopc.atlassian.net and the reply-to address is jsdk-support@prosysopc.com. If you haven’t received the mail, please send mail to jsdk-support@prosysopc.com.

P.S.
We will try to change so that it would also send the mails as jsdk-support@prosysopc.com, so to a future reader the sender might be ‘jsdk-support@prosysopc.com’.

Forum Timezone: Europe/Helsinki
Most Users Ever Online: 1919
Currently Online:
Guest(s) 47
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 100
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 773
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1558
Posts: 6567
Newest Members:
SheilaNag, freddiehuntsman, Sentra, linwoodpedley, martin.fires@kuka.com, coin24.io, nyx05, laitcanard, arianne1886, mirau07632
Moderators: Jouni Aro: 1039, Pyry: 1, Petri: 1, Bjarne Boström: 1054, Jimmy Ni: 26, Matti Siponen: 359, Lusetti: 0
Administrators: admin: 1