Composite component PropertyNotFoundException: UINamingContainer does not have the property

Home / jsf / Composite component PropertyNotFoundException: UINamingContainer does not have the property

Question:
I made a composite component for upload files that have a datatable (to show uploaded files) like this:


File Upload Component


<>

<>




and the backing component
@FacesComponent(value="components.Customfileupload")
public class CustomFileUpload extends UIInput implements NamingContainer, Serializable {

private List list;

@Override
public void restoreState(FacesContext context, Object state) {
Object values[] = (Object[]) state;
super.restoreState(context, values[0]);
list = (List) values[1];
}

@Override
public Object saveState(FacesContext context) {
Object[] values = new Object[2];
values[0] = super.saveState(context);
values[1] = list;
return values;
}

public void init() {
ValueExpression expr = super.getValueExpression("list");
ELContext ctx = super.getFacesContext().getELContext();
this.list = (List) expr.getValue(ctx);
}

public List getList() {
return list;
}

<>
Using

When use alone works ok, but when use with another composite component in same page throws exception:Exception type: class javax.el.PropertyNotFoundException
Exception message: …/fileupload.xhtml @59,100 value="#{cc.list}": The class ‘javax.faces.component.UINamingContainer’ does not have the property ‘list’.
I’ve more composite components that works fine together. The exception occurs only for fileupload. This problem seems to be similar with this topic, but in my case the composite components doesn’t nested.

Edit: The composite component used together with mpc:fileupload is mpc:balloon that uses basically primefaces overlayPanel
If I replace mpc:balloon by p:overlayPanel in page xhtml the exception doesn’t occurs anymore

Stack trace
javax.el.PropertyNotFoundException: ../fileupload.xhtml @58,100 value="#{cc.list}": The class ‘javax.faces.component.UINamingContainer’ does not have the property ‘list’.
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:111)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182)
at javax.faces.component.UIData.getValue(UIData.java:730)
at org.primefaces.component.api.UIData.getDataModel(UIData.java:764)
at org.primefaces.component.api.UIData.setRowModel(UIData.java:571)
at org.primefaces.component.api.UIData.setRowIndexWithoutRowStatePreserved(UIData.java:564)
at org.primefaces.component.api.UIData.setRowIndex(UIData.java:473)
at javax.faces.component.UIData.invokeOnComponent(UIData.java:1039)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1466)
at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:671)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1466)
at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:671)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1466)
at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:671)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1466)
at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:671)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1466)
at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:671)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1466)
at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:671)
at org.primefaces.component.api.UITabPanel.invokeOnComponent(UITabPanel.java:798)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1466)
at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:671)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1466)
at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:671)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1466)
at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:671)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1466)
at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:671)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1466)
at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:671)
at org.primefaces.util.ComponentTraversalUtils.firstById(ComponentTraversalUtils.java:151)
at org.primefaces.expression.SearchExpressionFacade.resolveComponentById(SearchExpressionFacade.java:521)
at org.primefaces.expression.SearchExpressionFacade.resolveClientIds(SearchExpressionFacade.java:246)
at org.primefaces.util.AjaxRequestBuilder.addExpressions(AjaxRequestBuilder.java:93)
at org.primefaces.util.AjaxRequestBuilder.update(AjaxRequestBuilder.java:86)
at org.primefaces.renderkit.CoreRenderer.buildAjaxRequest(CoreRenderer.java:389)
at org.primefaces.component.commandbutton.CommandButtonRenderer.buildRequest(CommandButtonRenderer.java:130)
at org.primefaces.component.commandbutton.CommandButtonRenderer.encodeMarkup(CommandButtonRenderer.java:69)
at org.primefaces.component.commandbutton.CommandButtonRenderer.encodeEnd(CommandButtonRenderer.java:54)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:877)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:312)
at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:105)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:847)
at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:85)
at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:72)
at org.primefaces.component.overlaypanel.OverlayPanelRenderer.encodeMarkup(OverlayPanelRenderer.java:59)
at org.primefaces.component.overlaypanel.OverlayPanelRenderer.encodeEnd(OverlayPanelRenderer.java:37)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:877)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:312)
at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:105)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:847)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1819)
at com.sun.faces.renderkit.html_basic.CompositeRenderer.encodeChildren(CompositeRenderer.java:78)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:847)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304)
at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:105)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:847)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1819)
at com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:543)
at com.sun.faces.component.visit.PartialVisitContext.invokeVisitCallback(PartialVisitContext.java:183)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1652)
at org.primefaces.component.api.UIData.visitColumnContent(UIData.java:1014)
at org.primefaces.component.api.UIData.visitRows(UIData.java:988)
at org.primefaces.component.api.UIData.visitTree(UIData.java:842)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)
at org.primefaces.component.api.UITabPanel.visitTree(UITabPanel.java:920)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)
at javax.faces.component.UIForm.visitTree(UIForm.java:362)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)
at com.sun.faces.context.PartialViewContextImpl.processComponents(PartialViewContextImpl.java:383)
at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:302)
at javax.faces.context.PartialViewContextWrapper.processPartial(PartialViewContextWrapper.java:183)
at org.primefaces.context.PrimePartialViewContext.processPartial(PrimePartialViewContext.java:57)
at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:973)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1819)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:421)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:125)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:286)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:286)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:286)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:100)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at org.omnifaces.filter.FacesExceptionFilter.doFilter(FacesExceptionFilter.java:56)
at org.omnifaces.filter.HttpFilter.doFilter(HttpFilter.java:77)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:512)
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:150)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:854)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926)
at java.lang.Thread.run(Thread.java:745)


Answer:

Read more

Leave a Reply

Your email address will not be published. Required fields are marked *