Nuxeo Server

JSF troubleshoot

Updated: October 13, 2017 Page Information Edit on GitHub

This page is scheduled for review and update. Check back soon for updated content!

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="[http://richfaces.org/a4j](http://richfaces.org/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:dataList>

or

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

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(MenuRenderer.java:356)
    at com.sun.faces.renderkit.html_basic.MenuRenderer.convertSelectManyValue(MenuRenderer.java:128)
    at com.sun.faces.renderkit.html_basic.MenuRenderer.getConvertedValue(MenuRenderer.java:314)
    at javax.faces.component.UIInput.getConvertedValue(UIInput.java:1046)
    at javax.faces.component.UIInput.validate(UIInput.java:976)
    at javax.faces.component.UIInput.executeValidate(UIInput.java:1249)
    at javax.faces.component.UIInput.processValidators(UIInput.java:712)
    at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1258)
    at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1258)
    at javax.faces.component.UIForm.processValidators(UIForm.java:253)
    at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1258)
    at org.nuxeo.ecm.platform.ui.web.component.holder.UIValueHolder.processComponent(UIValueHolder.java:258)
    at org.nuxeo.ecm.platform.ui.web.component.holder.UIValueHolder.processFacetsAndChildren(UIValueHolder.java:237)
    at org.nuxeo.ecm.platform.ui.web.component.holder.UIValueHolder.processFacetsAndChildrenWithVariable(UIValueHolder.java:245)
    at org.nuxeo.ecm.platform.ui.web.component.holder.UIValueHolder.processValidators(UIValueHolder.java:184)
    at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1258)
    at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1258)
    at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:1195)
    at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646)
    ... 66 more

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

    <h:selectManyCheckbox id="#{widget.id}_checkbox" value="#{field}"
        layout="pageDirection" collectionType="java.util.ArrayList">
        <nxu:selectItems
            value="#{aBean.getValues()}"
            var="item" itemValue="#{item.id}"
            itemLabel="#{item.label}"/>
    </h:selectManyCheckbox>

 


 

5 days ago manonlumeau NXDOC-1346-FT review screenshot
a year ago Anahide Tchertchian 29
a year ago Anahide Tchertchian 28
2 years ago Guillaume Renard 27
2 years ago Solen Guitter 26 | Add TOC
3 years ago Anahide Tchertchian 25 | add deprecation warning
3 years ago Manon Lumeau 24
3 years ago Manon Lumeau 23 | typos
6 years ago Anahide Tchertchian 21
6 years ago Anahide Tchertchian 22 | Migrated to Confluence 4.0
6 years ago Anahide Tchertchian 20
6 years ago Anahide Tchertchian 19
7 years ago Stéfane Fermigier 18
7 years ago Stéfane Fermigier 17
7 years ago Stéfane Fermigier 16
7 years ago Stéfane Fermigier 15
7 years ago Stéfane Fermigier 14
7 years ago Stéfane Fermigier 13
7 years ago Stéfane Fermigier 12
7 years ago Stéfane Fermigier 11
7 years ago Stéfane Fermigier 10
7 years ago Stéfane Fermigier 9
7 years ago Stéfane Fermigier 8
7 years ago Stéfane Fermigier 7
7 years ago Stéfane Fermigier 6
7 years ago Stéfane Fermigier 5
7 years ago Stéfane Fermigier 4
7 years ago Stéfane Fermigier 3
7 years ago Stéfane Fermigier 2
7 years ago Stéfane Fermigier 1
History: Created by Stéfane Fermigier