Known Issues (general)

Bauke Scholtz edited this page Mar 28, 2018 · 22 revisions

This wiki lists known issues of OmniFaces in combination with specific JSF implementations, JSF component libraries and application servers. Note: for known issues with specific CDI features, head to Known Issues (CDI).

Mojarra 2.0.0-2.1.7

When the <o:highlight> or <o:onloadScript> is been used with javax.faces.PARTIAL_STATE_SAVING set to false (which is not the default setting), then it will fail during a postback as follows:

java.lang.ArrayIndexOutOfBoundsException: 1
    at javax.faces.component.UIComponentBase.processRestoreState(
    at javax.faces.component.UIComponentBase.processRestoreState(
    at javax.faces.component.UIComponentBase.processRestoreState(
    at javax.faces.component.UIViewRoot.processRestoreState(
    at com.sun.faces.application.StateManagerImpl.restoreView(
    at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(
    at com.sun.faces.application.view.MultiViewHandler.restoreView(
    at javax.faces.application.ViewHandlerWrapper.restoreView(
    at javax.faces.application.ViewHandlerWrapper.restoreView(
    at com.sun.faces.lifecycle.RestoreViewPhase.execute(
    at com.sun.faces.lifecycle.Phase.doPhase(
    at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(
    at com.sun.faces.lifecycle.LifecycleImpl.execute(
    at javax.faces.webapp.FacesServlet.service(

This is related to Mojarra issue 2037 and is fixed since Mojarra 2.1.8.

Mojarra 2.1.11

When the CombinedResourceHandler is used, you will get the following exception during a postback when using Mojarra 2.1.11 (this and only this version, older versions work fine):


This is caused by a Mojarra bug in state saving of dynamically manipulated components. This has been reported as Mojarra issue 2471 and is fixed in Mojarra 2.1.12.

Mojarra 2.0.0-2.1.13

When the Html5RenderKit is used in combination with different <h:inputText type>, then the <f:ajax> will skip those inputs during preparing the query string. This has been reported as Mojarra issue 2532 and is fixed in Mojarra 2.1.14.

Mojarra 2.1.22-2.1.23

The <o:onloadScript> is not invoked at end of body during a synchronous postback. This is caused by an unknown bug in Mojarra and is fixed since 2.1.24. You should however upgrade to OmniFaces 1.6 if you're using 2.1.24 or newer. The <o:onloadScript> of OmniFaces 1.5 and older still works fine on 2.1.21 or older.

MyFaces 2.0.0-2.0.7 / 2.1.0-2.1.1

Deploy of a webapp with the since OmniFaces 1.1 introduced InvokeActionEventListener / PreInvokeActionEvent / PostInvokeActionEvent will fail with the following exception:

java.lang.NullPointerException: type
    at org.apache.myfaces.shared_impl.util.ClassUtils.classForName(
    at org.apache.myfaces.config.FacesConfigurator.configureRuntimeConfig(
    at org.apache.myfaces.config.FacesConfigurator.configure(
    at org.apache.myfaces.webapp.AbstractFacesInitializer.buildConfiguration(
    at org.apache.myfaces.webapp.Jsp21FacesInitializer.initContainerIntegration(
    at org.apache.myfaces.webapp.AbstractFacesInitializer.initFaces(
    at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(

This is caused by a MyFaces bug in registering custom JSF events which are annotated by @NamedEvent. This has been reported as MyFaces issue 3277 and is fixed in MyFaces 2.0.8/2.1.2.

MyFaces 2.0.17 / 2.1.11

Rendering of a page with <o:viewParam> / <o:enableRestorableView> (in fact, anything which needs to go into <f:metadata>) will fail with the following exception:

java.lang.IllegalStateException: component with duplicate id "someId" found
    at org.apache.myfaces.view.facelets.compiler.CheckDuplicateIdFaceletUtils.checkIds(
    at org.apache.myfaces.view.facelets.compiler.CheckDuplicateIdFaceletUtils.checkIds(
    at org.apache.myfaces.view.facelets.compiler.CheckDuplicateIdFaceletUtils.checkIds(
    at org.apache.myfaces.view.facelets.compiler.CheckDuplicateIdFaceletUtils.checkIds(
    at org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy.saveView(
    at org.apache.myfaces.application.StateManagerImpl.saveView(
    at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(
    at org.apache.myfaces.application.ViewHandlerImpl.renderView(
    at javax.faces.application.ViewHandlerWrapper.renderView(
    at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(
    at org.apache.myfaces.lifecycle.LifecycleImpl.render(
    at javax.faces.webapp.FacesServlet.service(

This is caused by a MyFaces bug in component ID generation. This has been reported as MyFaces issue 3709 and is fixed in MyFaces 2.0.18/2.1.12.

MyFaces 2.3.0

<o:onloadScript> fails on every ajax request with:

java.lang.AbstractMethodError: org.omnifaces.component.script.OnloadScript$1.getWrapped()Ljavax/faces/context/ResponseWriter;
    at org.omnifaces.component.script.OnloadScript$1.writeText(
    at org.apache.myfaces.view.facelets.compiler.LiteralTextInstruction.write(
    at org.apache.myfaces.view.facelets.compiler.UIInstructions.encodeBegin(
    at org.apache.myfaces.view.facelets.compiler.UILeaf.encodeAll(
    at javax.faces.component.UIComponentBase.encodeChildren(
    at org.omnifaces.component.script.OnloadScript.processEvent(
    at javax.faces.event.SystemEvent.processListener(
    at javax.faces.event.ComponentSystemEvent.processListener(
    at org.apache.myfaces.application._ApplicationUtils._traverseListenerListWithCopy(

This is caused by a bug in MyFaces. This has been reported as issue 4208 and will be fixed in 2.3.1.

MyFaces 2.3.x

@ViewScoped unload will in OmniFaces 2.6.8 or older fail as below (not affecting the web application's functionality, only the memory usage):

java.lang.ClassCastException: [B cannot be cast to java.base/java.lang.Integer
    at org.omnifaces.util.Hacks.removeViewState(
    at org.omnifaces.viewhandler.OmniViewHandler.unloadView(
    at org.omnifaces.viewhandler.OmniViewHandler.restoreView(
    at javax.faces.application.ViewHandlerWrapper.restoreView(

This is caused by a bug in OmniFaces and is fixed in 2.6.9.

PrimeFaces 2.0-3.1

The FullAjaxExceptionHandler will not work on PrimeFaces ajax requests, because PrimeFaces did by design not support an ajax render of @all before version 3.2. If you can't upgrade to at least PrimeFaces 3.2, then you can workaround it with the following script which should be loaded after PrimeFaces' own scripts (just referencing it by <h:outputScript> anywhere in the view ought to be sufficient):

var originalPrimeFacesAjaxResponseFunction = PrimeFaces.ajax.AjaxResponse;
PrimeFaces.ajax.AjaxResponse = function(responseXML) {
   var newViewRoot = $(responseXML.documentElement).find("update[id='javax.faces.ViewRoot']").text();
    if (newViewRoot) {
       $('head').html(newViewRoot.substring(newViewRoot.indexOf("<head>") + 6, newViewRoot.indexOf("</head>")));
       $('body').html(newViewRoot.substring(newViewRoot.indexOf("<body>") + 6, newViewRoot.indexOf("</body>")));
    else {
        originalPrimeFacesAjaxResponseFunction.apply(this, arguments);

PrimeFaces Mobile (all versions)

PrimeFaces Mobile is incompatible with CombinedResourceHandler. It does not make use of JSF component resource facility. Instead, all CSS/JS resources are hardcoded in the PageRenderer. Also, any custom styles/scripts are been added as a facet of the page instead of to the <h:head>. The CombinedResourceHandler is only capable of combining JSF component resources, not hardcoded or faceted resources.

PrimeFaces Extensions <=0.7.1-4.0.0 (and probably future versions)

PrimeFaces Extensions JS resource primefaces-extensions.js is incompatible with CombinedResourceHandler. During load, it attempts to figure the version from its own <script> element in order to dynamically load additional CSS/JS resources. This is however absent and the attempt fails with a JS error which in turn causes the dynamic loading of additional CSS/JS resources for e.g. CKEditor to fail.

Your best bet is to exclude primefaces-extensions.js from combining by adding the following entry to web.xml telling the CombinedResourceHandler to not combine the PrimeFaces Extensions main script file:


If you're using PrimeFaces Extensions before version 3.0.0, then you also need to make sure that the PrimeFaces Extensions own resource handler is explicitly declared after CombinedResourceHandler in faces-config.xml:


RichFaces 4.3.1-4.3.2 (and probably future versions)

RichFaces custom implementation of PartialViewContext is not delegating to the endDocument() call when the current PartialResponseWriter does not seem to be an instance of their own implementation, but is instead wrapped by the one from another JSF library, such as OmniFaces, PrimeFaces and more. This will result in broken ajax responses in certain environments wherein RichFaces is initialized before the other JSF library. See also issue 191.

GlassFish 3.x

In GlassFish 3.x the request scope is not available in a request listener. Attempting to instantiate a request scoped bean from within such request listener will thus result in a context not active exception.

Furthermore, instantiating session scoped beans from within a session listener will corrupt the session, causing an exception like the following when accessing the session afterwards:

java.lang.IllegalArgumentException: Should never reach here
   at org.apache.catalina.connector.SessionTracker.track(
   at org.apache.catalina.connector.Request.doGetSession(
   at org.apache.catalina.connector.Request.getSession(
   at org.apache.catalina.connector.RequestFacade.getSession(
   at javax.servlet.http.HttpServletRequestWrapper.getSession(
   at com.sun.faces.context.ExternalContextImpl.getSession(
   at javax.faces.context.ExternalContextWrapper.getSession(
   at javax.faces.context.ExternalContextWrapper.getSession(

There is a workaround available that's documented here:

(last tested with GlassFish

GlassFish 3.x and 4.0.0 (anything older than 4.0.1)

Since OmniFaces 1.6, which features new CDI artifacts, the deploy of a webapp which uses EJB, but which doesn't use CDI, will cause an exception with the following root cause in GlassFish 3.x and 4.0.0 during creating the EJBs:

Caused by: java.lang.NullPointerException
    at java.util.concurrent.ConcurrentHashMap.hash(
    at java.util.concurrent.ConcurrentHashMap.get(
    at org.jboss.weld.manager.BeanManagerImpl.getBean(
    at org.jboss.weld.manager.BeanManagerImpl.getBean(
    at com.sun.ejb.containers.BaseContainer.createEjbInstanceAndContext(
    at com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(
    ... 82 more

This is caused because GlassFish by default implicitly checks for CDI artifacts in JARs but doesn't properly register them when the webapp itself is in first place not configured to use CDI. This has been reported as GlassFish issue 20566 and is fixed in 4.0.1. There are 2 workarounds if you can't upgrade:

  1. Enable CDI anyway in your web application by creating/generating the /WEB-INF/beans.xml file.

  2. Disable implicit CDI artifact checking by executing the following asadmin command:

     $GFHOME/bin/asadmin set configs.config.server-config.cdi-service.enable-implicit-cdi=false

See also issue 215.

GlassFish 4.0.0

Using #{now} and #{startup} will cause an exception with the following root cause:

Caused by: java.lang.NullPointerException
    at org.glassfish.weld.DeploymentImpl.findRootBda(
    at org.glassfish.weld.DeploymentImpl.getBeanDeploymentArchive(
    at org.jboss.weld.manager.BeanManagerLookupService.lookupBeanManager(
    at org.jboss.weld.manager.BeanManagerLookupService.lookupBeanManager(
    at org.jboss.weld.manager.BeanManagerImpl.getInjectionTargetFactory(
    at org.jboss.weld.manager.BeanManagerImpl.createInjectionTarget(
    at org.glassfish.faces.integration.GlassFishInjectionProvider.inject(
    at com.sun.faces.mgbean.BeanBuilder.injectResources(
    at com.sun.faces.mgbean.BeanManager.createAndPush(
    at com.sun.faces.mgbean.BeanManager.create(
    at com.sun.faces.el.ManagedBeanELResolver.resolveBean(
    at com.sun.faces.el.ManagedBeanELResolver.getValue(
    at com.sun.faces.el.DemuxCompositeELResolver._getValue(
    at com.sun.faces.el.DemuxCompositeELResolver.getValue(
    at com.sun.el.parser.AstIdentifier.getValue(
    at com.sun.el.ValueExpressionImpl.getValue(
    at org.jboss.weld.el.WeldValueExpression.getValue(
    at com.sun.faces.facelets.el.ELText$ELTextVariable.writeText(
    at com.sun.faces.facelets.el.ELText$ELTextComposite.writeText(
    at com.sun.faces.facelets.compiler.TextInstruction.write(
    ... 39 more

The cause is unknown. This is already reported as GlassFish issue 20775, which appears to be fixed in GlassFish 4.1 as consequence of another bugfix. If you can't upgrade to GlassFish 4.1, then a workaround would be to create #{now} (and #{startup}) yourself using a servlet filter. See also this Stack Overflow question.

Liberty 1.0.x (8.5.x) / WebSphere 8.5.x

CDI injection in converters and validators does not work in Liberty 1.0.x (8.5.x) and WebSphere 8.5.x. There'll be no exception, but a null value is injected instead of the actual instance.

The problem is caused by the fact that the mentioned servers from IBM (Liberty and WebSphere thus) ship with a very old version of MyFaces, namely 2.0.4. Among its many bugs, a particular problem is with state management (related to This was fixed in MyFaces 2.0.8 and 2.1.2.

Unfortunately it's not really feasible to upgrade MyFaces in those IBM servers.

The workaround is to have Converters and Validators implement the Serializable interface.

See for additional details.

(last tested with Liberty 1.0.5 (

Resin 4.0.38 (anything older than 4.0.40)

Resin 4.0.38 it doesn't support generic producer methods which causes a failed deployment. On Resin 4.0.40 this will work correctly.

Resin 4.0.40 (likely all versions)

On Resin the <o:methodParam> tag handler doesn't work for actions, but does work for action listeners. It will result in an exception like the following:

javax.el.ELException: //server/omnifaces-showcase/WEB-INF/tags/actionmethod.xhtml @8,53 action="#{method}": 'method' is an illegal method expression on com.caucho.el.ValueExpr
at com.sun.faces.facelets.el.TagMethodExpression.invoke(
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(
at com.sun.faces.application.ActionListenerImpl.processAction(
at javax.faces.component.UICommand.broadcast(
at javax.faces.component.UIViewRoot.broadcastEvents(
at javax.faces.component.UIViewRoot.processApplication(
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(
at com.sun.faces.lifecycle.Phase.doPhase(
at com.sun.faces.lifecycle.LifecycleImpl.execute(
at javax.faces.webapp.FacesServlet.service(
at com.caucho.server.dispatch.ServletFilterChain.doFilter(

(last tested on Resin 4.0.40)

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.