this.rootCollectionNode is null

Hello,

I ran into the following with openfire 4.9.2 and OpenJDK21U-jre_ppc64_aix_hotspot_21.0.5_11. The database is oracle 12.2 used with ojdbc8.jar from oracle instantclient 12.2.

2025.01.16 02:50:04.504 WARN  [socket_c2s_ssl-thread-16]: org.jivesoftware.openfire.entitycaps.EntityCapabilitiesManager - An exception occurred while dispatching entity capabilities changed event for entity 'tester@server/ws4' to listener 'org.jivesoftware.openfire.pep.PEPServiceManager@5a7f88ae'.
java.lang.NullPointerException: Cannot invoke "org.jivesoftware.openfire.pubsub.CollectionNode.getSubscription(org.xmpp.packet.JID)" because "this.rootCollectionNode" is null
        at org.jivesoftware.openfire.pep.PEPService.sendLastPublishedItems(PEPService.java:510) ~[xmppserver-4.9.2.jar:4.9.2]
        at org.jivesoftware.openfire.pep.PEPServiceManager.entityCapabilitiesChanged(PEPServiceManager.java:324) ~[xmppserver-4.9.2.jar:4.9.2]
        at org.jivesoftware.openfire.entitycaps.EntityCapabilitiesManager.dispatch(EntityCapabilitiesManager.java:683) ~[xmppserver-4.9.2.jar:4.9.2]
        at org.jivesoftware.openfire.entitycaps.EntityCapabilitiesManager.registerCapabilities(EntityCapabilitiesManager.java:580) ~[xmppserver-4.9.2.jar:4.9.2]
        at org.jivesoftware.openfire.entitycaps.EntityCapabilitiesManager.receivedAnswer(EntityCapabilitiesManager.java:404) ~[xmppserver-4.9.2.jar:4.9.2]
        at org.jivesoftware.openfire.IQRouter.handle(IQRouter.java:317) ~[xmppserver-4.9.2.jar:4.9.2]
        at org.jivesoftware.openfire.IQRouter.route(IQRouter.java:106) ~[xmppserver-4.9.2.jar:4.9.2]
        at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:74) ~[xmppserver-4.9.2.jar:4.9.2]
        at org.jivesoftware.openfire.net.StanzaHandler.processIQ(StanzaHandler.java:392) ~[xmppserver-4.9.2.jar:4.9.2]
        at org.jivesoftware.openfire.net.ClientStanzaHandler.processIQ(ClientStanzaHandler.java:90) ~[xmppserver-4.9.2.jar:4.9.2]
        at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:334) ~[xmppserver-4.9.2.jar:4.9.2]
        at org.jivesoftware.openfire.net.StanzaHandler.processStanza(StanzaHandler.java:222) ~[xmppserver-4.9.2.jar:4.9.2]
        at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:114) ~[xmppserver-4.9.2.jar:4.9.2]
        at org.jivesoftware.openfire.nio.NettyConnectionHandler.channelRead0(NettyConnectionHandler.java:142) ~[xmppserver-4.9.2.jar:4.9.2]
        at org.jivesoftware.openfire.nio.NettyConnectionHandler.channelRead0(NettyConnectionHandler.java:50) ~[xmppserver-4.9.2.jar:4.9.2]
        at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) ~[netty-transport-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) ~[netty-codec-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318) ~[netty-codec-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:289) ~[netty-handler-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[netty-transport-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.handler.traffic.AbstractTrafficShapingHandler.channelRead(AbstractTrafficShapingHandler.java:506) ~[netty-handler-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[netty-transport-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1475) ~[netty-handler-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1338) ~[netty-handler-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1387) ~[netty-handler-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:530) ~[netty-codec-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:469) ~[netty-codec-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290) ~[netty-codec-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[netty-transport-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[netty-transport-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[netty-transport-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) ~[netty-transport-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) ~[netty-transport-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) ~[netty-transport-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) ~[netty-transport-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) ~[netty-transport-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.108.Final.jar:4.1.108.Final]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.108.Final.jar:4.1.108.Final]
        at java.lang.Thread.run(Unknown Source) [?:?]

Hi John! It appears that a user-specific database resource wasn’t initialized. Do the Openfire logs contain a database error (possibly related to tables that have pubsub in their name) prior to the message that you already provided?

No database errors in the logs. The only interesting pubsub related entry I found is:

2025.01.19 02:33:29.784 INFO  [main]: org.jivesoftware.openfire.pubsub.PubSubModule - Not starting service with name 'pubsub', as pubsub is disabled by configuration.

Oh, that might very well explain it. PEP (the functionality that’s causing you to have an issue) is a subset of Pub/Sub functionality. If that’s disabled, then that might explain the exception that you’re seeing.

Did you turn off pubsub purposefully? Can you try enabling it again, to see if that error goes way? You can enable/disable pubsub via the admin console, under Server > Pubsub

Even when disabled, Openfire shouldn’t be generating those warnings, but still, it would be good to be able to tell if the two are related.

Yes I disabled that because I don’t need it. I should have mentioned that I’m not getting errors when using the server. But having quite some of these exceptions in the logs didn’t look right.

If I can just ignore them in this case it’s fine.

Well, something isn’t quite right. I would expect you to be still able to use PEP, even if you disable the public pub/sub service (many clients will give you additional functionality when PEP is available).

There was one thing I had to change when I imported the sql file. One of the tables had a varchar 4000 field and an index on that. I had to reduce it to 3000 because the blocksize of my db is 4k and oracle indexes cannot exceed the db’s blocksize for a single index. I would have to check the sql file to find the affected table if that should be of interest.

Please do. Is that a default setting, that block size? Would another column definition (eg: use a character-large object instead of a varchar) make sense for that type?

It was:

CREATE TABLE ofSASLAuthorized (
  username            VARCHAR(64)   NOT NULL,
  principal           VARCHAR(4000) NOT NULL,
  CONSTRAINT ofSASLAuthorized_pk PRIMARY KEY (username, principal)
);

Makes no difference in my case because I don’t use sasl. And I don’t know whether clob would make sense there because I don’t know what data is supposed to be stored there. If you wanna be on the safe side though, changing principal to clob should make it work in any case.

Then however openfire should have a length check for this if it doesn’t have one already because clobs can be large if for some reason the inserted data gets out of hand.

:face_with_peeking_eye: I don’t think that this database table is used at all, by anything. If that’s the case, then we should simply remove it. I’ve raised an issue for that, here: [OF-2956] - Ignite Realtime Jira

1 Like