JSF troubleshoot

Updated: March 18, 2024

JSF UI Deprecation
This requires to have the JSF UI addon installed on your server that is deprecated since Nuxeo Platform LTS 2019.
Please refer to the Web UI documentation.

Although they are not all specific to Nuxeo framework, here are some troubleshooting issues that can be encountered with JSF.

My file is not uploaded correctly although other fields are set

Make sure your <h:form> tag accepts multipart content: <h:form enctype="multipart/form-data">.

My ajax action does not work

There could be lots of reasons for this to happen. The easiest way to find the cause is to add a <a4j:log /> tag to your xhtml page, and then open it using CTRL+SHIFT+l. You'll get ajax debug logs in a popup window and hopefully will understand what is the problem.

Also make sure you have the right namespace: xmlns:a4j="[](".

My variable is not resolved correctly

A lot of different causes could explain with a variable is not resolved properly, but here are some recommandations to avoid known problems.

When exposing a variable for EL resolution, note that there are some reserved keywords. For instance in tags like:

<nxu:dataList var="action" value="#{actions}">


<nxu:inputList model="model" value="#{myList}">

or even:

<c:set var="foo" value="bar" />

The reserved keywords are: "application", "applicationScope", "cookie", "facesContext", "header", "headerValues", "initParam", "param", "paramValues", "request", "requestScope", "session", "sessionScope", and "view".

All values in the EL context for one of these keywords will resolve to request information instead of mapping your value.

ClassCastException on h:selectManyCheckbox (or such) jsf tag

If you see the following stacktrace:

Caused by: java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.util.Collection
    at com.sun.faces.renderkit.html_basic.MenuRenderer.convertSelectManyValuesForModel(
    at com.sun.faces.renderkit.html_basic.MenuRenderer.convertSelectManyValue(
    at com.sun.faces.renderkit.html_basic.MenuRenderer.getConvertedValue(
    at javax.faces.component.UIInput.getConvertedValue(
    at javax.faces.component.UIInput.validate(
    at javax.faces.component.UIInput.executeValidate(
    at javax.faces.component.UIInput.processValidators(
    at javax.faces.component.UIComponentBase.processValidators(
    at javax.faces.component.UIComponentBase.processValidators(
    at javax.faces.component.UIForm.processValidators(
    at javax.faces.component.UIComponentBase.processValidators(
    at org.nuxeo.ecm.platform.ui.web.component.holder.UIValueHolder.processComponent(
    at org.nuxeo.ecm.platform.ui.web.component.holder.UIValueHolder.processFacetsAndChildren(
    at org.nuxeo.ecm.platform.ui.web.component.holder.UIValueHolder.processFacetsAndChildrenWithVariable(
    at org.nuxeo.ecm.platform.ui.web.component.holder.UIValueHolder.processValidators(
    at javax.faces.component.UIComponentBase.processValidators(
    at javax.faces.component.UIComponentBase.processValidators(
    at javax.faces.component.UIViewRoot.processValidators(
    at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(
    at com.sun.faces.lifecycle.Phase.doPhase(
    at com.sun.faces.lifecycle.LifecycleImpl.execute(
    at javax.faces.webapp.FacesServlet.service(
    ... 66 more

add collectionType="java.util.ArrayList" to the jsf tag causing the error.

    <h:selectManyCheckbox id="#{}_checkbox" value="#{field}"
        layout="pageDirection" collectionType="java.util.ArrayList">
            var="item" itemValue="#{}"