In Openfire 5.0.0, the embedded webserver (Jetty) was upgraded to version 12. Many plugins that are developed
against older versions of Openfire are known to be compatible, and will continue to work. That, however, is not
the case for all plugins. This guide describes the most common issues.
Note that many of the problems are caused by relatively simple package changes. Quite often, a class with the
same (or very similar) name than the one that's no longer available can be found in another Java package.
New in Jetty 12 is that the Servlet layer has been separated away from the Jetty Core layer. The Servlet layer
has been moved to the new Environments concept introduced with Jetty 12. Openfire 5.0.0 is using the Jakarta EE8
environment, which retains the javax.servlet packages known from earlier versions. The associated
Jetty GroupId is org.eclipse.jetty.ee8, which is commonly used as a (part of) a Jetty java package
name.
Update parent POM and Admin Console page (JSP) compilation
Most Openfire plugins inherit from the parent pom provided by the org.igniterealtime.org:plugins
artifact. For version 5.0.0, this updates that Maven plugin used for compilation of the JSP pages that make up
the admin console. Be sure to modify the Maven plugin that's defined in your pom.xml when you
update parent plugin version to 5.0.0 (or later). The required changes are illustrated in the examples below.
New WebAppContext
When a plugin uses a org.eclipse.jetty.webapp.WebAppContext that is registered with Openfire's
embedded webserver that serves public content through org.jivesoftware.openfire.http.HttpBindManager.addJettyHandler(org.eclipse.jetty.server.Handler)
then migration to org.eclipse.jetty.ee8.webapp.WebAppContext may cause runtime class cast errors.
Two solutions are available in Openfire 5.0.0:
In Openfire 5.0.0, an overloaded method org.jivesoftware.openfire.http.HttpBindManager#addJettyHandler(org.eclipse.jetty.ee8.nested.ContextHandler) was added. This can be used directly with your org.eclipse.jetty.ee8.webapp.WebAppContext instance.
The original method org.jivesoftware.openfire.http.HttpBindManager#addJettyHandler(org.eclipse.jetty.server.Handler) can be invoked with the 'core' context handler that can be obtained through org.eclipse.jetty.ee8.nested.ContextHandler#get
By virtue of the new overloaded method described in the first option, it's likely that your implementation needs little change to register the context handler.
Known Error Details and Potential Solutions
This section provides further details on the errors observed and offers suggestions for addressing them.
Partially blank Admin Console pages
When a plugin-provided admin console page is mostly blank, then there might have been a problem during compilation of the JSP file that makes up the page.
If this problem occurs in relation to the upgrade to Openfire 5.0.0, then check the Maven configuration of your plugin. Ensure that both
the 'parent' pom that's being used is version 5.0.0 (or later)
the old JSPC compiler plugin has been replaced by the new one (note that both the groupId and artifactId have changed).
java.lang.VerifyError: Bad type on operand stack
Consider using org.eclipse.jetty.server.Handler.Wrapper (javadoc) to replace org.eclipse.jetty.server.handler.HandlerWrapper usage.
Consider using the EE8 ConstraintSecurityHandler from org.eclipse.jetty.ee8.security.ConstraintSecurityHandler to replace org.eclipse.jetty.security.ConstraintSecurityHandler.
Consider using the EE8 JettyWebSocketServlet from org.eclipse.jetty.ee8.websocket.server.JettyWebSocketServlet to replace org.eclipse.jetty.websocket.server.JettyWebSocketCreator.