powered by Jive Software

NPE when joining a room in Openfire 4.1.6


#1

Sometimes client can not join some muc room,and server throw NullPointerException at LocalMUCRoom#joinRoom L690.

The tracker has same issue, but my server just has single node, and it can not reproduce every time.

I am trying to trace code, the joinRole variable is null when exception is thrown. In that moment, user’s full jid is even not in occupantsByFullJID.

error log

2018.05.24 12:47:30 org.jivesoftware.openfire.muc.spi.MultiUserChatServiceImpl - Internal server error
java.lang.NullPointerException
        at org.jivesoftware.openfire.muc.cluster.OccupantAddedEvent.<init>(OccupantAddedEvent.java:57) ~[openfire.jar:?]
        at org.jivesoftware.openfire.muc.spi.LocalMUCRoom.joinRoom(LocalMUCRoom.java:699) ~[openfire.jar:?]
        at org.jivesoftware.openfire.muc.spi.LocalMUCUser.process(LocalMUCUser.java:474) ~[openfire.jar:?]
        at org.jivesoftware.openfire.muc.spi.LocalMUCUser.process(LocalMUCUser.java:177) ~[openfire.jar:?]
        at org.jivesoftware.openfire.muc.spi.MultiUserChatServiceImpl.processPacket(MultiUserChatServiceImpl.java:366) [openfire.jar:?]
        at org.jivesoftware.openfire.component.InternalComponentManager$RoutableComponents.process(InternalComponentManager.java:606) [openfire.jar:?]
        at org.jivesoftware.openfire.spi.RoutingTableImpl.routeToComponent(RoutingTableImpl.java:407) [openfire.jar:?]
        at org.jivesoftware.openfire.spi.RoutingTableImpl.routePacket(RoutingTableImpl.java:249) [openfire.jar:?]
        at org.jivesoftware.openfire.PresenceRouter.handle(PresenceRouter.java:166) [openfire.jar:?]
        at org.jivesoftware.openfire.PresenceRouter.route(PresenceRouter.java:80) [openfire.jar:?]
        at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:88) [openfire.jar:?]
        at org.jivesoftware.openfire.net.StanzaHandler.processPresence(StanzaHandler.java:359) [openfire.jar:?]
        at org.jivesoftware.openfire.net.ClientStanzaHandler.processPresence(ClientStanzaHandler.java:106) [openfire.jar:?]
        at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:276) [openfire.jar:?]
        at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:198) [openfire.jar:?]
        at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandler.java:181) [openfire.jar:?]
        at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:690) [openfire.jar:?]
        at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417) [openfire.jar:?]
        at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47) [openfire.jar:?]
        at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765) [openfire.jar:?]
        at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:109) [openfire.jar:?]
        at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417) [openfire.jar:?]
        at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47) [openfire.jar:?]
        at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765) [openfire.jar:?]
        at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:407) [openfire.jar:?]
        at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:236) [openfire.jar:?]
        at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417) [openfire.jar:?]
        at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47) [openfire.jar:?]
        at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765) [openfire.jar:?]
        at org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:74) [openfire.jar:?]
        at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63) [openfire.jar:?]
        at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTask(OrderedThreadPoolExecutor.java:769) [openfire.jar:?]
        at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTasks(OrderedThreadPoolExecutor.java:761) [openfire.jar:?]
        at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.run(OrderedThreadPoolExecutor.java:703) [openfire.jar:?]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]

Another similar error is happend in LocalMUCRoom#kickPresence, but it get a null occupants by nickname.