Project

General

Profile

Can't use AdHocCommansModule in jaxmpp 3.0.0

Martxel Lasa
Added about 4 years ago

Hello!

I'm using Jaxmpp 3.0.0 and whenever I try to use the AdHocCommansModule I get a NullPointerException:

jaxmpp.login(true);

// I can use the DiscoveryModule without issues
DiscoveryModule discoModule = jaxmpp.getModulesManager().getModule(DiscoveryModule.class);

// But I can't use the AdHocCommansModule. The adHocModule variable is null so I get a NPE.
AdHocCommansModule adHocModule = jaxmpp.getModulesManager().getModule(AdHocCommansModule.class);

My maven dependencies include jaxmpp-all and jaxmpp-j2se.

Any ideas?

EDIT:

It seems like the AdHocCommansModule is not registered automatically so I added:

jaxmpp.getModulesManager().register(new AdHocCommansModule());

And now I can use it. Not sure if this is intended.


Replies (2)

(1)

Added by Wojciech Kapcia TigaseTeam about 4 years ago

Martxel Lasa wrote:

It seems like the AdHocCommansModule is not registered automatically so I added:

And now I can use it. Not sure if this is intended.

Yes, this is intended and result of splitting library into modules. Basically you need to register all modules that are not part of the core library (e.g. adhocs)

Added by Martxel Lasa about 4 years ago

It makes sense, thank you.

    (1-2/2)