4 Replies Latest reply on Jan 15, 2008 10:10 AM by Nicolai Abruzzese

    Help, <s:convertEntity /> problem

    Nicolai Abruzzese Newbie

      I was writting the code for and app to add a record to the database:
      (I've translated the code from spanish, asume the code has no typo)

      this is a form to add a currency, the currency has a country mapped to it.
      The xhtml form uses a tempate with <s:vallidateAll>
      Here the monedaNueva.xhtml:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:s="http://jboss.com/products/seam/taglib"
       xmlns:a4j="http://richfaces.org/a4j"
       xmlns:rich="http://richfaces.org/rich">
       <f:loadBundle basename="messages" var="m"/>
       <ui:composition template="/WEB-INF/template.xhtml">
       <ui:define name="title" value="#{m['TIT_PRIN_CREA_currency']}"></ui:define>
       <body>
      
       <ui:define name="body">
       <fieldset><h1><legend jsfc="h:outputText" value="#{m['E_CONTEN_DATOS_currency']}"></legend></h1>
       <s:decorate template="editar.xhtml">
       <ui:define name="label">
       <label jsfc="h:outputLabel" for="code" value="#{m['E_code']}"></label>
       </ui:define>
       <input jsfc="h:inputText" type="text" id="code" size="10" value="#{currency.code}"/>
       </s:decorate>
       <br/><br/>
       <s:decorate template="editar.xhtml">
       <ui:define name="label">
       <label jsfc="h:outputLabel" for="name" value="#{m['E_name']}"></label>
       </ui:define>
       <input jsfc="h:inputText" value="#{currency.name}" type="text" id="name" size="50" checked="checked" layout = "lineDirection"/>
       </s:decorate>
       <br/><br/>
       <s:decorate template="editar.xhtml">
       <ui:define name="label">
       <label jsfc="h:outputLabel" for="codeISO" value="#{m['E_COD_ISO']}"></label>
       </ui:define>
       <input jsfc="h:inputText" value="#{currency.codeIso}" type="text" id="codeISO" size="10" />
       </s:decorate>
       <br/><br/>
       <s:decorate template="editar.xhtml">
       <ui:define name="label">
       <label jsfc="h:outputLabel" for="abreviacion" value="#{m['E_ABREV']}"></label>
       </ui:define>
       <input jsfc="h:inputText" value="#{currency.abreviacion}" type="text" id="abreviacion" size="10" />
       </s:decorate>
       <br/><br/>
       <s:decorate template="editar.xhtml">
       <ui:define name="label">
       <label jsfc="h:outputLabel" for="country" value="#{m['E_country']}"></label>
       </ui:define>
      
       <h:selectOneMenu id="country" value="#{currency.country}">
       <s:selectItems value="#{countryLista}" var="aCountry" label="#{aCountry.name}" />
      
       </h:selectOneMenu>
       <s:convertEntity />
       </s:decorate>
       </fieldset>
       </ui:define>
       <ui:define name="BarraEspecifica">
       <h:commandButton value="#{m['BOTON_GRABAR']}" action="#{currencyAdministrador.save}"/>
       <input type="submit" jsfc="h:commandButton" value="#{m['BOTON_GRABAR']}" action="#{currencyAdministrador.save}" view="/currencyList.xhtml" propagation="begin"/>
       <input type="submit" jsfc="h:commandButton" value="#{m['BOTON_CANCELAR']}" action="#{currencyAdministrador.cancel}" view="/currencyList.xhtml" propagation="end"/>
       </ui:define>
      
       </body>
       </ui:composition>
      </html>
      



      ...
      <s:decorate template="edit.xhtml">
       <ui:define name="label">
       <label jsfc="h:outputLabel" for="country" value="#{m['E_COUNTRY']}"></label>
       </ui:define>
      
       <h:selectOneMenu id="country" value="#{currency.country}">
       <s:selectItems value="#{countryList}" var="aCountry" label="#{aContry.name}" />
      
       </h:selectOneMenu>
      
      </s:decorate>
      ...


      And an error came out:
      Conversion Error setting value ....Country@qw12... 'null Converter'.
      


      So I've added the <s:convertEntity /> under the <s:selectItems line:

      ...
      <s:decorate template="edit.xhtml">
       <ui:define name="label">
       <label jsfc="h:outputLabel" for="country" value="#{m['E_COUNTRY']}"></label>
       </ui:define>
      
       <h:selectOneMenu id="country" value="#{currency.country}">
       <s:selectItems value="#{countryList}" var="aCountry" label="#{aContry.name}" />
       <s:convertEntity />
       </h:selectOneMenu>
      
      </s:decorate>
      ...


      After I've added the <s:convertEntity /> I try enter the xhtml page and the following error comes out:

      com.sun.facelets.tag.TagException: /monedaNueva.xhtml @55,48 <s:convertEntity> Parent not an instance of ValueHolder: org.jboss.seam.ui.component.html.HtmlValidateAll@7d734b
       at com.sun.facelets.tag.jsf.ConvertHandler.apply(ConvertHandler.java:93)
       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:310)
       at com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:280)
       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:144)
       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.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:310)
       at com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:280)
       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.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.jsf.core.ViewHandler.apply(ViewHandler.java:109)
       at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
       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:144)
       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:216)
       at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
       at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
       at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:307)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       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.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:42)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
       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:44)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
       at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
       at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
       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.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:230)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:595)
      


      can't solve it so far.
      Any ideas? (in advance, thanks for your time)



        • 1. Re: Help, <s:convertEntity /> problem
          Nicolai Abruzzese Newbie

          ok, begginers mistake!, fixed! (<s:convertEntity /> in the wrong line)

          ...
          <h:selectOneMenu id="pais" value="#{moneda.pais}">
           <s:selectItems value="#{paisLista}" var="unpais" label="#{unpais.nombre}" />
           <s:convertEntity />
           </h:selectOneMenu>
          ....
          


          But the problem persist:

          java.lang.NullPointerException
           at org.jboss.seam.ui.converter.EntityConverterStore.getEntityManager(EntityConverterStore.java:81)
           at org.jboss.seam.ui.converter.EntityConverterStore.put(EntityConverterStore.java:60)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:585)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
           at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
           at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
           at org.jboss.seam.util.Work.workInTransaction(Work.java:40)
           at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
           at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:155)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:91)
           at org.jboss.seam.ui.converter.EntityConverterStore_$$_javassist_2.put(EntityConverterStore_$$_javassist_2.java)
           at org.jboss.seam.ui.converter.EntityConverter.getAsString(EntityConverter.java:67)
           at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getFormattedValue(HtmlBasicRenderer.java:469)
           at com.sun.faces.renderkit.html_basic.MenuRenderer.renderOption(MenuRenderer.java:502)
           at com.sun.faces.renderkit.html_basic.MenuRenderer.renderOptions(MenuRenderer.java:757)
           at com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:811)
           at com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:335)
           at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:836)
           at org.jboss.seam.ui.util.cdk.RendererBase.renderChild(RendererBase.java:190)
           at org.jboss.seam.ui.util.cdk.RendererBase.renderChildren(RendererBase.java:166)
           at org.jboss.seam.ui.renderkit.ValidateAllRendererBase.doEncodeChildren(ValidateAllRendererBase.java:33)
           at org.jboss.seam.ui.util.cdk.RendererBase.encodeChildren(RendererBase.java:92)
           at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
           at org.jboss.seam.ui.util.cdk.RendererBase.renderChild(RendererBase.java:186)
           at org.jboss.seam.ui.util.cdk.RendererBase.renderChildren(RendererBase.java:166)
           at org.jboss.seam.ui.renderkit.DecorateRendererBase.doEncodeChildren(DecorateRendererBase.java:104)
           at org.jboss.seam.ui.util.cdk.RendererBase.encodeChildren(RendererBase.java:92)
           at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
           at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
           at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
           at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
           at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
           at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
           at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
           at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
           at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
           at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
           at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
           at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:307)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           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.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:42)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
           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:44)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
           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.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:230)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
           at java.lang.Thread.run(Thread.java:595)
          


          My code for the entity: (forget all typo's I've translated the code from spanish)
          @Stateful
          
          @Name("currencyAdministrador")
          
          @Scope(ScopeType.CONVERSATION)
          public class CurrencyAdministradorImpl extends EntityHome<Currency> implements CurrencyAdministrador, Serializable{
          
           @RequestParameter Long currencyId;
          
           @PersistenceContext(unitName = "entityManager", type=PersistenceContextType.EXTENDED)
           EntityManager entityManager;
          
           @DataModel
           private List<Currency> currencyList;
          
           @DataModelSelection
           private Currency currencySelected;
          
           @In("#{currency}")
           @Out("#{currency}")
           public Currency currency ;
          
           @In("#{country}")
           @Out("#{country}")
           public Country country ;
          
           @In("#{currency}")
           @Out("#{currency}")
           public Currency copyObj ;
          
           @Out(scope=ScopeType.CONVERSATION,required=false)
           Map<Currency, Boolean> CurrencyErase = new HashMap<Currency, Boolean>();
          
           @Logger
           Log log;
          
          
           @Factory("currency")
           public Currency initObj() {
           return getInstance();
           }
          
           @Override
           public EntityManager getEntityManager() {
           return entityManager;
           }
          
           @Override
           public Object getId() {
           if(currencyId == null){
           return super.getId();
           }else{
           return currencyId;
          
           }
          
           }
          
           @Factory("currencyList")
           public String listAll() {
           CurrencyList = entityManager.createQuery("from Currency ").getResultList();
          
           return null;
           }
          
           @Begin(join=true)
           public String selectObj() {
          
           try {
           BeanUtils.copyProperties(currency, currencySelected);
          
           return "/currencyVisualizacion.xhtml";
          
           } catch (IllegalAccessException ex) {
           throw new RuntimeException(ex);
           } catch (InvocationTargetException ex) {
           throw new RuntimeException(ex);
           }
           }
          
           @End
           public String save() {
          
           //getInstance().setCountry(Country);
           String persist = persist();
          
           return null;
           }
          
           @End
           public String update() {
          
          
           entityManager.merge(getInstance());
           String persist = super.update();
          
           return "/currencyListado.xhtml";
           }
          
           @End
           public String borrar() {
          
           setInstance(currencySelectioned);
           remove();
           listAll();
          
          
           return "/currencyListado.xhtml";
          
           }
          
           @End
           public String borrarVarios() {
          
           for (Currency item: currencyList) {
           Boolean selected = currencyErase.get(item);
          
           if (selected!=null && selected) {
           currencyErase.put(item, false);
           entityManager.remove(item);
          
          
           }
           }
           listAll();
           return null;
          
           }
          
           @End
           public String cancelar() {
           return "/currencyListado.xhtml";
           }
          
           @Remove
           @Destroy
           public void destroy() {
          
           }
          
          }
          
          


          • 2. Re: Help, <s:convertEntity /> problem
            Oded S. Newbie

            I'm stuck on the exact same problem, if anyone has the answer, it would be great.

            Thanks :).

            • 3. Re: Help, <s:convertEntity /> problem
              Pete Muir Master

              You need to use an SMPC with the entity converter and configure it components.xml if not called entityManager.

              I improved the error message in CVS (no more NPE :)

              • 4. Re: Help, <s:convertEntity /> problem
                Nicolai Abruzzese Newbie

                ok, solved, I've just Overrided the HashCode and Equals methods, that was all, do not Override toString() method.

                @Override
                 public boolean equals(Object obj) {
                 if (obj == null) {
                 return false;
                 }
                 if (getClass() != obj.getClass()) {
                 return false;
                 }
                 final ParamBase other = (ParamBase) obj;
                 if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
                 return false;
                 }
                 return true;
                 }
                
                 @Override
                 public int hashCode() {
                 int hash = 7;
                 hash = 97 * hash + (this.id != null ? this.id.hashCode() : 0);
                 return hash;
                 }