powered by Jive Software

NPE in Default PubSubPersistenceProvider

Hello,
i am getting theese errors on a newest master (14.04.2020) with latest commits related to pubsub.

org.jivesoftware.openfire.pubsub.DefaultPubSubPersistenceProvider - ConnectionManager.getConnection() failed to obtain a connection after 11 retries. The exception from the last attempt is as follows: java.sql.SQLException: Cannot get a connection, pool error Timeout waiting for idle object
java.sql.SQLException: ConnectionManager.getConnection() failed to obtain a connection after 11 retries. The exception from the last attempt is as follows: java.sql.SQLException: Cannot get a connection, pool error Timeout waiting for idle object
	at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager.java:204) ~[xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pubsub.DefaultPubSubPersistenceProvider.loadPEPServiceFromDB(DefaultPubSubPersistenceProvider.java:1706) ~[xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pubsub.CachingPubsubPersistenceProvider.loadPEPServiceFromDB(CachingPubsubPersistenceProvider.java:567) ~[xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pep.PEPServiceManager.getPEPService(PEPServiceManager.java:175) ~[xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pep.PEPServiceManager.getPEPService(PEPServiceManager.java:130) ~[xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pep.PEPServiceManager.getPEPService(PEPServiceManager.java:100) ~[xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pubsub.Node.getService(Node.java:1203) ~[xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pubsub.Node.saveToDB(Node.java:1783) ~[xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pep.PEPService.<init>(PEPService.java:183) ~[xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pubsub.DefaultPubSubPersistenceProvider.loadPEPServiceFromDB(DefaultPubSubPersistenceProvider.java:1716) ~[xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pubsub.CachingPubsubPersistenceProvider.loadPEPServiceFromDB(CachingPubsubPersistenceProvider.java:567) ~[xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pep.PEPServiceManager.getPEPService(PEPServiceManager.java:175) ~[xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pep.PEPServiceManager.getPEPService(PEPServiceManager.java:130) ~[xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pep.PEPServiceManager.getPEPService(PEPServiceManager.java:100) ~[xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pubsub.Node.getService(Node.java:1203) ~[xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pubsub.DefaultPubSubPersistenceProvider.createNode(DefaultPubSubPersistenceProvider.java:267) ~[xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pubsub.CachingPubsubPersistenceProvider.process(CachingPubsubPersistenceProvider.java:352) ~[xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at java.util.ArrayList.forEach(ArrayList.java:1249) ~[?:1.8.0_65]
	...
	at org.jivesoftware.openfire.pubsub.CachingPubsubPersistenceProvider.flushPendingNodes(CachingPubsubPersistenceProvider.java:155) [xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pubsub.CachingPubsubPersistenceProvider.loadNodes(CachingPubsubPersistenceProvider.java:223) [xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pep.PEPService.<init>(PEPService.java:174) [xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pubsub.DefaultPubSubPersistenceProvider.loadPEPServiceFromDB(DefaultPubSubPersistenceProvider.java:1716) [xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pubsub.CachingPubsubPersistenceProvider.loadPEPServiceFromDB(CachingPubsubPersistenceProvider.java:567) [xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pep.PEPServiceManager.getPEPService(PEPServiceManager.java:175) [xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pep.PEPServiceManager.getPEPService(PEPServiceManager.java:130) [xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pep.PEPServiceManager.getPEPService(PEPServiceManager.java:114) [xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.vcard.xep0398.PEPAvatar.getPEPFromUser(PEPAvatar.java:248) [xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.vcard.xep0398.PEPAvatar.load(PEPAvatar.java:160) [xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.handler.PresenceUpdateHandler.mergeAvatarHashIntoPresence(PresenceUpdateHandler.java:343) [xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.handler.PresenceUpdateHandler.broadcastUpdate(PresenceUpdateHandler.java:312) [xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.handler.PresenceUpdateHandler.process(PresenceUpdateHandler.java:154) [xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.handler.PresenceUpdateHandler.process(PresenceUpdateHandler.java:137) [xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.handler.PresenceUpdateHandler.process(PresenceUpdateHandler.java:205) [xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.PresenceRouter.handle(PresenceRouter.java:143) [xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.PresenceRouter.route(PresenceRouter.java:79) [xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:84) [xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.net.StanzaHandler.processPresence(StanzaHandler.java:399) [xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.net.ClientStanzaHandler.processPresence(ClientStanzaHandler.java:102) [xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:292) [xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:210) [xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandler.java:183) [xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:1015) [mina-core-2.1.3.jar:?]
	at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:650) [mina-core-2.1.3.jar:?]
	at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1300(DefaultIoFilterChain.java:49) [mina-core-2.1.3.jar:?]
	at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:1128) [mina-core-2.1.3.jar:?]
	at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:122) [mina-core-2.1.3.jar:?]
	at org.jivesoftware.openfire.plugin.RawPrintFilter.messageReceived(RawPrintFilter.java:107) [xmldebugger-1.7.2.jar!/:?]
	at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:650) [mina-core-2.1.3.jar:?]
	at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1300(DefaultIoFilterChain.java:49) [mina-core-2.1.3.jar:?]
	at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:1128) [mina-core-2.1.3.jar:?]
	at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:122) [mina-core-2.1.3.jar:?]
	at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:650) [mina-core-2.1.3.jar:?]
	at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1300(DefaultIoFilterChain.java:49) [mina-core-2.1.3.jar:?]
	at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:1128) [mina-core-2.1.3.jar:?]
	at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:413) [mina-core-2.1.3.jar:?]
	at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:257) [mina-core-2.1.3.jar:?]
	at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:650) [mina-core-2.1.3.jar:?]
	at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1300(DefaultIoFilterChain.java:49) [mina-core-2.1.3.jar:?]
	at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:1128) [mina-core-2.1.3.jar:?]
	at org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:106) [mina-core-2.1.3.jar:?]
	at org.apache.mina.core.session.IoEvent.run(IoEvent.java:89) [mina-core-2.1.3.jar:?]
	at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTask(OrderedThreadPoolExecutor.java:766) [mina-core-2.1.3.jar:?]
	at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTasks(OrderedThreadPoolExecutor.java:758) [mina-core-2.1.3.jar:?]
	at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.run(OrderedThreadPoolExecutor.java:697) [mina-core-2.1.3.jar:?]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_65]
2020.04.14 16:59:15 org.jivesoftware.openfire.handler.IQHandler - Interner Serverfehler
java.lang.NullPointerException: null
	at org.jivesoftware.openfire.pubsub.DefaultPubSubPersistenceProvider.createNode(DefaultPubSubPersistenceProvider.java:267) ~[xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pubsub.CachingPubsubPersistenceProvider.process(CachingPubsubPersistenceProvider.java:352) ~[xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at java.util.ArrayList.forEach(ArrayList.java:1249) ~[?:1.8.0_65]
	at org.jivesoftware.openfire.pubsub.CachingPubsubPersistenceProvider.flushPendingNodes(CachingPubsubPersistenceProvider.java:155) ~[xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pubsub.CachingPubsubPersistenceProvider.loadNodes(CachingPubsubPersistenceProvider.java:223) ~[xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pep.PEPService.<init>(PEPService.java:174) ~[xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pep.PEPServiceManager.create(PEPServiceManager.java:222) ~[xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pep.PEPServiceManager.getPEPService(PEPServiceManager.java:183) ~[xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pep.PEPServiceManager.getPEPService(PEPServiceManager.java:144) ~[xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pep.IQPEPHandler.handleIQSetToService(IQPEPHandler.java:370) ~[xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.pep.IQPEPHandler.handleIQ(IQPEPHandler.java:314) ~[xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.handler.IQHandler.process(IQHandler.java:62) [xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.IQRouter.handle(IQRouter.java:369) [xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]
	at org.jivesoftware.openfire.IQRouter.route(IQRouter.java:112) [xmppserver-4.6.0-SNAPSHOT.jar:4.6.0-SNAPSHOT]

Yeah, I’ve seen that too earlier today. Seems that the service creation requires a service to have been created. :unamused: I’ll try to look into this issue later this week.

1 Like

Thanks… i am allways happy to test new things :wink:

1 Like

I’ve logged this as OF-2016 in our issue tracker.

A fix is in the works here: https://github.com/igniterealtime/Openfire/pull/1628

I’d like to emphasize that this issue was never present in any release of Openfire. It was introduced by recent changes. The fix should be applied before a release is made.