NullPointerException on sending initial presence, involves privacy lists

a little involved, so bear with me. we’'re running wildfire 2.6.2 and seeing a NullPointerException in the server logs when certain users log in and send their initial presence. the exception is caught by the server and logged in PresenceUpdateHandler.process(

as far as i can tell, 2 conditions must be met to make this error happen:

  1. the client must create a non-empty privacy list and make it active (i put 1 entry in with a made up jid and type=’‘allow’’)

  2. there must be a pending subscription request directed at the client, sent while the client was unavailable

i’'ll give a concrete example to clarify. suppose i have 2 accounts, test1 and test2. test2 sends a subscription request to test1 while test1 is unavailable. test1 creates a non-empty privacy list, makes it active, and then becomes available. wildfire should throw the exception i mentioned above.

when this exception occurs, i do not receive any indication from the server that something has gone wrong. the behavior that led me to look in the logs in the first place was that the server failed to deliver presence stanzas to the client for some (but not all) of the user’'s contacts who were online at the time.

has anybody seen anything similar to this? i can provide more details if necessary

Hey Matt,

Could you post the complete stack trace for the error that appeared in your log file?



i don’'t see a stack trace in the error / warn / info / debug logs. the exception is caught by wildfire, which prints the following:

2006.06.30 11:06:21 org.jivesoftware.wildfire.handler.PresenceUpdateHandler.process(PresenceUpdateHa Internal server error. Triggered by packet:


that’‘s it, there’'s no stack trace after that last line. we are right now working on using a debugger to get a stack trace, until then this is the best info i have about the context

ok, running wildfire under a debugger yielded the following information.

stack trace is:

PrivacyItem.verifyJID(JID, Roster) line: 157

PrivacyItem.matchesPacketSenderCondition(Packet, Roster) line: 144

PrivacyItem.matchesCondition(Packet, Roster, JID) line: 126

PrivacyList.shouldBlockPacket(Packet) line: 101

ClientSession.shouldBlockPacket(Packet) line: 739

ClientSession.process(Packet) line: 745

PresenceUpdateHandler.initSession(ClientSession) line: 199

PresenceUpdateHandler.process(Packet) line: 100

PresenceUpdateHandler.process(Presence) line: 153

PresenceRouter.handle(Presence) line: 92

PresenceRouter.route(Presence) line: 61

PacketRouter.route(Presence) line: 73

ClientSocketReader(SocketReader).processPresence(Presence) line: 445

ClientSocketReader.processPresence(Presence) line: 56

ClientSocketReader(SocketReader).readStream() line: 242

ClientSocketReader(SocketReader).run() line: 119 line: 595

the source line in question is:

return jid.equals(jidValue);

jid is null, and jidValue is not null. the Roster argument to verifyJID is also null. the Packet that is being processed appears to be the subscription request that was sent to my account while i was offline.

Hey Matt,

Thanks for the bug report. The problem has been fixed so you can try again using the next nightly build. BTW, the problem was not only a NPE but there was also a bad filtering logic that was fixed.


– Gato

we got the nightly build of wildfire 3 from 07/03 and are still seeing the NullPointerException under these conditions. it’'s still being caught and logged at

Message was edited by: mphears

Did you have the full stack trace for this exception, this would be helpful in diagnosing this issue?


at org.jivesoftware.wildfire.privacy.PrivacyItem.verifyJID(

at org.jivesoftware.wildfire.privacy.PrivacyItem.matchesPacketSenderCondition(Priv

at org.jivesoftware.wildfire.privacy.PrivacyItem.matchesCondition( :127)

at org.jivesoftware.wildfire.privacy.PrivacyList.shouldBlockPacket(PrivacyList.jav a:102)

at org.jivesoftware.wildfire.ClientSession.shouldBlockPacket( 2)

at org.jivesoftware.wildfire.ClientSession.process(

at org.jivesoftware.wildfire.handler.PresenceUpdateHandler.initSession(PresenceUpd

at org.jivesoftware.wildfire.handler.PresenceUpdateHandler.process(PresenceUpdateH

at org.jivesoftware.wildfire.handler.PresenceUpdateHandler.process(PresenceUpdateH

at org.jivesoftware.wildfire.PresenceRouter.handle(

at org.jivesoftware.wildfire.PresenceRouter.route(

at org.jivesoftware.wildfire.spi.PacketRouterImpl.route(

at 6)




at 62)



Try again using the next nightly build. Let us know how it goes.


– Gato

this problem appears to be fixed (i tested against the 07/07 build). thanks for your help