Project

General

Profile

Packet.getStanzaFrom() NoSuchMethodError

Matt Q Public
Added 19 days ago

I'm writing a Component, and have been getting errors with JIDs. Here I'm trying to find out who a packet is from, so I can do a thing.

@Override
public void processPacket(Packet packet) {
if(packet.getStanzaFrom().toString().equals(myUsername)){
// Do my thing.
}
}

When I run this Component, and send it a packet, I get the following error:

2017-11-03 22:52:16.315 [in_0-tigase-remote-component] ThreadExceptionHandler.uncaughtException() SEVERE: Uncaught thread: "in_0-tigase-remote-component" exception
java.lang.NoSuchMethodError: tigase.server.Packet.getStanzaFrom()Ltigase/xmpp/jid/JID;
at TigaseRemoteComponent.processPacket(TigaseRemoteComponent.java:18)
at tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1570)

Why can't it find the Packet.getStanzaFrom() method?


Replies (2)

Added by Andrzej Wójcik 19 days ago

Recently we moved classes JID and BareJID from package tigase.xmpp to package tigase.xmpp.jid. Looking at your error it looks like you are developing your component using newest snapshot build of Tigase XMPP Server, which has JID and BareJID already moved but you are starting component on the server where an older version of Tigase XMPP Server is deployed (build from before the move).

Please try to upgrade your installation to newest snapshot build of Tigase XMPP Server and this should solve this error.

Added by Matt Q Public 15 days ago

Yes, it was a version mismatch. Fixed it. Thank you.

    (1-2/2)