- Openfire 5.0.2
- Java-21-OpenJDK-21.0.3.0.9-1.el9.alma.1
- Bundled search plugin
I noticed on startup I am getting an error in the openfire.log:
2025-10-02T12:52:21.763Z DEBUG [PluginMonitorTask-2]: org.apache.jasper.servlet.JasperInitializer - Initializing Jasper for context [ROOT]
2025-10-02T12:52:21.764Z DEBUG [PluginMonitorTask-2]: org.apache.jasper.servlet.JasperInitializer - Tld pre-scan detected
2025-10-02T12:52:21.779Z DEBUG [PluginMonitorTask-2]: org.apache.jasper.servlet.TldScanner - No TLD files were found in resource path [/WEB-INF/].
2025-10-02T12:52:21.803Z DEBUG [PluginMonitorTask-2]: org.apache.jasper.servlet.JspServlet - Scratch dir for the JSP engine is: [/var/opt/openfire/tmp/jetty-__1-9090-webapp-_-any-5264178830726977181/jsp]
2025-10-02T12:52:21.803Z DEBUG [PluginMonitorTask-2]: org.apache.jasper.servlet.JspServlet - IMPORTANT: Do not modify the generated servlets
2025-10-02T12:52:21.840Z INFO [PluginMonitorTask-2]: org.jivesoftware.openfire.container.AdminConsolePlugin - Admin console listening at http://::1:9090
2025-10-02T12:52:21.840Z DEBUG [PluginMonitorTask-2]: org.jivesoftware.openfire.container.PluginManager - Initialized plugin 'admin'.
2025-10-02T12:52:21.841Z INFO [PluginMonitorTask-2]: org.jivesoftware.openfire.container.PluginManager - Successfully loaded plugin 'admin'.
2025-10-02T12:52:21.868Z DEBUG [PluginMonitorExec-3]: org.jivesoftware.openfire.container.PluginManager - Loading plugin 'search'...
2025-10-02T12:52:21.880Z DEBUG [PluginMonitorExec-3]: org.jivesoftware.util.WebXmlUtils - Found 2 servlet name(s): org.jivesoftware.openfire.plugin.search.search_002dprops_002dedit_002dform_jsp, org.jivesoftware.openfire.plugin.search.advance_002duser_002dsearch_jsp
2025-10-02T12:52:21.881Z DEBUG [PluginMonitorExec-3]: org.jivesoftware.openfire.container.PluginServlet - Loading servlet 'org.jivesoftware.openfire.plugin.search.search_002dprops_002dedit_002dform_jsp' of plugin 'search'...
2025-10-02T12:52:21.881Z DEBUG [PluginMonitorExec-3]: org.jivesoftware.util.WebXmlUtils - Found class name for servlet 'org.jivesoftware.openfire.plugin.search.search_002dprops_002dedit_002dform_jsp': org.jivesoftware.openfire.plugin.search.search_002dprops_002dedit_002dform_jsp
2025-10-02T12:52:21.891Z DEBUG [PluginMonitorExec-3]: org.jivesoftware.openfire.container.PluginServlet - Initializing servlet 'org.jivesoftware.openfire.plugin.search.search_002dprops_002dedit_002dform_jsp' of plugin 'search'...
2025-10-02T12:52:21.892Z DEBUG [PluginMonitorExec-3]: org.jivesoftware.util.WebXmlUtils - Found 0 init-params(s) for servlet 'org.jivesoftware.openfire.plugin.search.search_002dprops_002dedit_002dform_jsp'
2025-10-02T12:52:21.893Z WARN [PluginMonitorExec-3]: org.jivesoftware.openfire.container.PluginServlet - Exception attempting to load servlet 'org.jivesoftware.openfire.plugin.search.search_002dprops_002dedit_002dform_jsp' (org.jivesoftware.openfire.plugin.search.search_002dprops_002dedit_002dform_jsp) of plugin 'search'
java.lang.NullPointerException: Cannot invoke "javax.servlet.ServletConfig.getServletContext()" because "org.jivesoftware.openfire.container.PluginServlet.servletConfig" is null
at org.jivesoftware.openfire.container.PluginServlet$1.getServletContext(PluginServlet.java:201) ~[xmppserver-5.0.2.jar:5.0.2]
at org.apache.jasper.runtime.TagHandlerPool.getOption(TagHandlerPool.java:162) ~[apache-jsp-9.0.107.jar:9.0.107]
at org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(TagHandlerPool.java:47) ~[apache-jsp-9.0.107.jar:9.0.107]
at org.jivesoftware.openfire.plugin.search.search_002dprops_002dedit_002dform_jsp._jspInit(search_002dprops_002dedit_002dform_jsp.java:109) ~[?:?]
at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:47) ~[apache-jsp-9.0.107.jar:9.0.107]
at org.jivesoftware.openfire.container.PluginServlet.registerServlets(PluginServlet.java:193) ~[xmppserver-5.0.2.jar:5.0.2]
at org.jivesoftware.openfire.container.PluginManager.loadPlugin(PluginManager.java:621) ~[xmppserver-5.0.2.jar:5.0.2]
at org.jivesoftware.openfire.container.PluginMonitor$MonitorTask.lambda$run$3(PluginMonitor.java:354) ~[xmppserver-5.0.2.jar:5.0.2]
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[?:?]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
2025-10-02T12:52:21.915Z DEBUG [PluginMonitorExec-3]: org.jivesoftware.openfire.container.PluginServlet - Loading servlet 'org.jivesoftware.openfire.plugin.search.advance_002duser_002dsearch_jsp' of plugin 'search'...
2025-10-02T12:52:21.916Z DEBUG [PluginMonitorExec-3]: org.jivesoftware.util.WebXmlUtils - Found class name for servlet 'org.jivesoftware.openfire.plugin.search.advance_002duser_002dsearch_jsp': org.jivesoftware.openfire.plugin.search.advance_002duser_002dsearch_jsp
2025-10-02T12:52:21.921Z DEBUG [PluginMonitorExec-3]: org.jivesoftware.openfire.container.PluginServlet - Initializing servlet 'org.jivesoftware.openfire.plugin.search.advance_002duser_002dsearch_jsp' of plugin 'search'...
2025-10-02T12:52:21.922Z DEBUG [PluginMonitorExec-3]: org.jivesoftware.util.WebXmlUtils - Found 0 init-params(s) for servlet 'org.jivesoftware.openfire.plugin.search.advance_002duser_002dsearch_jsp'
2025-10-02T12:52:21.922Z WARN [PluginMonitorExec-3]: org.jivesoftware.openfire.container.PluginServlet - Exception attempting to load servlet 'org.jivesoftware.openfire.plugin.search.advance_002duser_002dsearch_jsp' (org.jivesoftware.openfire.plugin.search.advance_002duser_002dsearch_jsp) of plugin 'search'
java.lang.NullPointerException: Cannot invoke "javax.servlet.ServletConfig.getServletContext()" because "org.jivesoftware.openfire.container.PluginServlet.servletConfig" is null
at org.jivesoftware.openfire.container.PluginServlet$1.getServletContext(PluginServlet.java:201) ~[xmppserver-5.0.2.jar:5.0.2]
at org.apache.jasper.runtime.TagHandlerPool.getOption(TagHandlerPool.java:162) ~[apache-jsp-9.0.107.jar:9.0.107]
at org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(TagHandlerPool.java:47) ~[apache-jsp-9.0.107.jar:9.0.107]
at org.jivesoftware.openfire.plugin.search.advance_002duser_002dsearch_jsp._jspInit(advance_002duser_002dsearch_jsp.java:120) ~[?:?]
at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:47) ~[apache-jsp-9.0.107.jar:9.0.107]
at org.jivesoftware.openfire.container.PluginServlet.registerServlets(PluginServlet.java:193) ~[xmppserver-5.0.2.jar:5.0.2]
at org.jivesoftware.openfire.container.PluginManager.loadPlugin(PluginManager.java:621) ~[xmppserver-5.0.2.jar:5.0.2]
at org.jivesoftware.openfire.container.PluginMonitor$MonitorTask.lambda$run$3(PluginMonitor.java:354) ~[xmppserver-5.0.2.jar:5.0.2]
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[?:?]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
2025-10-02T12:52:21.924Z DEBUG [PluginMonitorExec-3]: org.jivesoftware.util.WebXmlUtils - Found 0 filter name(s):
2025-10-02T12:52:21.926Z DEBUG [PluginMonitorExec-3]: org.jivesoftware.openfire.component.InternalComponentManager - InternalComponentManager: Registering component for domain: search
2025-10-02T12:52:21.933Z DEBUG [PluginMonitorExec-3]: org.jivesoftware.openfire.component.InternalComponentManager - InternalComponentManager: Component registered for domain: search
2025-10-02T12:52:21.934Z DEBUG [PluginMonitorExec-3]: org.jivesoftware.openfire.container.PluginManager - Initialized plugin 'search'.
2025-10-02T12:52:21.965Z INFO [PluginMonitorExec-3]: org.jivesoftware.openfire.container.PluginManager - Successfully loaded plugin 'search-1.8.0-SNAPSHOT'.
2025-10-02T12:52:21.966Z INFO [PluginMonitorTask-2]: org.jivesoftware.openfire.container.PluginMonitor - Finished processing all plugins.
2025-10-02T12:52:21.966Z DEBUG [PluginMonitorTask-2]: org.jivesoftware.openfire.spi.ConnectionManagerImpl - Received plugin monitor event! Plugins should now be loaded.
2025-10-02T12:52:21.966Z DEBUG [PluginMonitorTask-2]: org.jivesoftware.openfire.spi.ConnectionManagerImpl - Received a request to start listeners. Have plugins been loaded?
2025-10-02T12:52:21.967Z DEBUG [PluginMonitorTask-2]: org.jivesoftware.openfire.spi.ConnectionManagerImpl - Starting listeners...
Tracing back the error, it is coming from:
Which the javadoc comment indicates the map can be empty, but not null. In the next function below it, which it calls, an empty map is created, but it seems line 229 is returning null when it gets back an empty map.
At first I thought it might have been something to do with the search plugin still using the Jetty 9.2.14.v20151106 jetty-jspc-maven-plugin, but when I replaced it with the Jetty 12.0.24 jetty-ee8-jspc-maven-plugin and set the xmppserver dependency to use Openfire 5.0.2 (to match the version in the xmppserver/pom.xml, per the plugin template comments), I still get the same error.
Java is not my primary language, so I could be way off in left field here, but I wonder if Openfire/xmppserver/src/main/java/org/jivesoftware/util/WebXmlUtils.java at 8b7759b5afcae75d3c0b6534974bb71279050b95 · igniterealtime/Openfire · GitHub needs to initialize a map before making the getInitParams call. Assign the call to the new map, then return that map. It feels like the empty map is getting implicitly changed to null in the passthrough of that call.
^^^^^^^^^^^^^^^^^^^
Scratch that. I tried it and I still get the same null reference passed back.