6 Replies Latest reply on Feb 21, 2011 9:00 AM by Flávio Henrique

    Richfaces 4 M6: <rich:validation/> and @NotNull in a Date field error

    Flávio Henrique Newbie

      I have this field that I want to use CSV

       

      <h:inputText id="idDataCasamento" label="Data de Casamento" value="#{meuMB.pessoaSelecionada.dataCasamento}" required="true">

                <f:convertDateTime pattern="dd/MM/yyyy" timeZone="America/Sao_Paulo" type="date" />

                          <rich:validator/>

                </h:inputText>

       

      In my model, I have this

       

      public Pessoa {

      @NotNull

      private Date dataCasamento;

       

       

      Only when @NotNull is present in the Model, I have this error message:

       

      GRAVE: Error Rendering View[/sortexample.xhtml]

      javax.faces.FacesException: Error in conversion Java Object to JavaScript

                at org.ajax4jsf.javascript.ScriptUtils.appendScript(ScriptUtils.java:192)

                at org.ajax4jsf.javascript.ScriptUtils.appendScript(ScriptUtils.java:204)

                at org.ajax4jsf.javascript.ScriptUtils.appendScript(ScriptUtils.java:144)

                at org.ajax4jsf.javascript.ScriptUtils.appendScript(ScriptUtils.java:248)

                at org.richfaces.renderkit.html.ClientOnlyScript.appendConverter(ClientOnlyScript.java:70)

                at org.richfaces.renderkit.html.ClientOnlyScript.appendParameters(ClientOnlyScript.java:47)

                at org.richfaces.renderkit.html.ValidatorScriptBase.appendParametersDefinition(ValidatorScriptBase.java:63)

                at org.richfaces.renderkit.html.ValidatorScriptBase.appendBody(ValidatorScriptBase.java:56)

                at org.ajax4jsf.javascript.JSFunctionDefinition.appendScript(JSFunctionDefinition.java:82)

                at org.ajax4jsf.javascript.ScriptUtils.appendScript(ScriptUtils.java:89)

                at org.ajax4jsf.javascript.ScriptUtils.toScript(ScriptUtils.java:238)

                at org.richfaces.context.ExtendedPartialViewContextImpl.renderExtensions(ExtendedPartialViewContextImpl.java:432)

                at org.richfaces.context.ExtendedPartialViewContextImpl.processPartialRenderPhase(ExtendedPartialViewContextImpl.java:290)

                at org.richfaces.context.ExtendedPartialViewContextImpl.processPartial(ExtendedPartialViewContextImpl.java:206)

                at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:974)

                at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1652)

                at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:388)

                at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)

                at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273)

                at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)

                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:313)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)

                at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:383)

                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)

                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)

                at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:288)

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

                at java.lang.Thread.run(Unknown Source)

      Caused by: java.lang.NoSuchMethodException: Read method for property 'startYear' not found

                at org.ajax4jsf.javascript.PropertyUtils.readPropertyValue(PropertyUtils.java:79)

                at org.ajax4jsf.javascript.ScriptUtils.appendScript(ScriptUtils.java:189)

                ... 37 more

      javax.faces.FacesException: Error in conversion Java Object to JavaScript

                at org.ajax4jsf.javascript.ScriptUtils.appendScript(ScriptUtils.java:192)

                at org.ajax4jsf.javascript.ScriptUtils.appendScript(ScriptUtils.java:204)

                at org.ajax4jsf.javascript.ScriptUtils.appendScript(ScriptUtils.java:144)

                at org.ajax4jsf.javascript.ScriptUtils.appendScript(ScriptUtils.java:248)

                at org.richfaces.renderkit.html.ClientOnlyScript.appendConverter(ClientOnlyScript.java:70)

                at org.richfaces.renderkit.html.ClientOnlyScript.appendParameters(ClientOnlyScript.java:47)

                at org.richfaces.renderkit.html.ValidatorScriptBase.appendParametersDefinition(ValidatorScriptBase.java:63)

                at org.richfaces.renderkit.html.ValidatorScriptBase.appendBody(ValidatorScriptBase.java:56)

                at org.ajax4jsf.javascript.JSFunctionDefinition.appendScript(JSFunctionDefinition.java:82)

                at org.ajax4jsf.javascript.ScriptUtils.appendScript(ScriptUtils.java:89)

                at org.ajax4jsf.javascript.ScriptUtils.toScript(ScriptUtils.java:238)

                at org.richfaces.context.ExtendedPartialViewContextImpl.renderExtensions(ExtendedPartialViewContextImpl.java:432)

                at org.richfaces.context.ExtendedPartialViewContextImpl.processPartialRenderPhase(ExtendedPartialViewContextImpl.java:290)

                at org.richfaces.context.ExtendedPartialViewContextImpl.processPartial(ExtendedPartialViewContextImpl.java:206)

                at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:974)

                at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1652)

                at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:388)

                at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)

                at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273)

                at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)

                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:313)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)

                at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:383)

                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)

                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)

                at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:288)

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

                at java.lang.Thread.run(Unknown Source)

      Caused by: java.lang.NoSuchMethodException: Read method for property 'startYear' not found

                at org.ajax4jsf.javascript.PropertyUtils.readPropertyValue(PropertyUtils.java:79)

                at org.ajax4jsf.javascript.ScriptUtils.appendScript(ScriptUtils.java:189)

                ... 37 more

       

      I can anyone confirm if I made a mistake of if this is an error?