TeamSpeak-3-Java-API icon indicating copy to clipboard operation
TeamSpeak-3-Java-API copied to clipboard

NullPointerException at .registerAllEvents()

Open SaftigeOrange opened this issue 2 years ago • 1 comments

Hello, when i load allEvents(".registerAllEvents()") i become a NullPointerException in my events class. This the error: Error Why is it so?

Thanks for helping

SaftigeOrange avatar May 14 '22 21:05 SaftigeOrange

Hi @SaftigeOrange

Could you please share the stack trace of the exception you're getting with us?

Also, it seems very suspicious that you're creating two instances of your TeamSpeakService. Are you sure you didn't mean to re-use the first TeamSpeakService?

That would explain why you, judging from the initial title, were getting an exception while trying to set your nickname. Nicknames on a TS3 server must be unique, so if you use a nickname that's already in use - as you would if you had 2 queries connecting to the same server and trying to use the same nickname - the command will fail and you'll get an exception.

rogermb avatar May 15 '22 21:05 rogermb