1 Reply Latest reply on Apr 1, 2009 12:55 AM by David Salter

    Error using entity converter

    Rafael Espirito Santo Newbie

      Hi...
      I have an error when using convertEntity on my project.
      This is the code of xhtml



                             



      <s:decorate id="areaPesquisaField" template="/layout/edit.xhtml">
                                      <ui:define name="label">#{messages['mensagem.areaPesquisa.label']}</ui:define>
                                      <h:selectOneListbox value="#{enviarMensagemForm.areaPesquisa}">
                                              <s:selectItems var="area" value="#{listaAreasDePesquisa}" label="#{area.nome}">
                                                      <s:convertEntity />
                                              </s:selectItems>
                                      </h:selectOneListbox>
                              </s:decorate>
      




                             


      This is the code of enviarMensagemForm




      private AreaPesquisa areasPesquisa;
              
              
              public AreaPesquisa getAreaPesquisa() {
                      return areaPesquisa;
              }
              public void setAreaPesquisa(AreaPesquisa areaPesquisa) {
                      this.areaPesquisa = areaPesquisa;
              }





      The code of @Factory


             


      @Override
              @Factory("listaAreasDePesquisa")
              public List<AreaPesquisa> carregarAreasDePesquisa() {
                      return entityManager.createQuery("select ap from AreaPesquisa ap").getResultList();
                      
              }





      When I enter the page i get the exception:




      com.sun.facelets.tag.TagException: /acessoRestrito/mensagens/mensagem.xhtml @21,26 <s:convertEntity> Parent not an instance of ValueHolder: org.jboss.seam.ui.component.html.HtmlSelectItems@7e221c
              at com.sun.facelets.tag.jsf.ConvertHandler.apply(ConvertHandler.java:93)
              at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
              at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
              at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
              at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
              at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
              at com.sun.facelets.tag.ui.DecorateHandler.apply(DecorateHandler.java:122)
              at com.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:337)
              at com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:307)
              at com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68)
              at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
              at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
              at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
              at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:119)
              at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
              at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
              at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
              at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
              at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
              at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:140)
              at com.sun.facelets.tag.ui.DecorateHandler.apply(DecorateHandler.java:105)
              at org.jboss.seam.ui.handler.DecorateHandler.applyNextHandler(DecorateHandler.java:32)
              at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
              at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
              at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
              at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
              at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
              at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
              at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
              at com.sun.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:64)
              at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:131)
              at com.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:337)
              at com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:307)
              at com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68)
              at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
              at com.sun.facelets.tag.jsf.core.ViewHandler.apply(ViewHandler.java:109)
              at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
              at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
              at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
              at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
              at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
              at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
              at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:140)
              at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113)
              at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
              at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
              at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
              at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:524)
              at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:567)
              at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
              at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:196)
              at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
              at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
              at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
              at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
              at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
              at java.lang.Thread.run(Thread.java:619)





      What is wrong?
      Thanks