3 Replies Latest reply on Sep 14, 2007 4:04 PM by Ronan Silva

    Suggestion about calendar ClassCastException...

    Ronan Silva Newbie

      Hi...

      I'm facing a problem with cast of Date for Calendar, my app I work with class Calendar, but the rich:calendar only work class Date.

      When I submit form, always the exception occurs:

      
      [0.0-8080-1] ERROR b].[localhost].[/amplis].[Faces Servlet] [] - Servlet.service() for servlet Faces Servlet threw exception
      java.lang.ClassCastException: com.base.datetime.MyCalendar
       at org.richfaces.renderkit.CalendarRendererBase.getSelectedDate(CalendarRendererBase.java:356)
       at org.richfaces.renderkit.html.CalendarRenderer.doEncodeEnd(CalendarRenderer.java:218)
       at org.richfaces.renderkit.html.CalendarRenderer.doEncodeEnd(CalendarRenderer.java:427)
       at org.ajax4jsf.renderkit.RendererBase.encodeEnd(RendererBase.java:135)
       at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:539)
       at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:286)
       at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
       at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:284)
       at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
       at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:284)
       at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
       at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:284)
       at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:143)
       at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:86)
       at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:134)
       at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:86)
       at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:134)
       at org.ajax4jsf.renderkit.AjaxContainerRenderer.encodeAjax(AjaxContainerRenderer.java:122)
       at org.ajax4jsf.component.AjaxViewRoot.encodeAjax(AjaxViewRoot.java:555)
       at org.ajax4jsf.context.AjaxContextImpl.renderAjaxRegion(AjaxContextImpl.java:289)
       at org.ajax4jsf.context.AjaxContextImpl$2.invoke(AjaxContextImpl.java:204)
       at org.ajax4jsf.context.JsfOneOneInvoker.invokeOnComponent(JsfOneOneInvoker.java:78)
       at org.ajax4jsf.context.AjaxContextImpl.invokeOnComponent(AjaxContextImpl.java:160)
       at org.ajax4jsf.context.AjaxContextImpl.renderSubmittedAjaxRegion(AjaxContextImpl.java:218)
       at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:239)
       at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      
      


      somebody could help me?

        • 1. Re: Suggestion about calendar ClassCastException...
          Ronan Silva Newbie

           

          "*Ninho*" wrote:
          Hi...

          I'm facing a problem with cast of Date for Calendar, my app I work with class Calendar, but the rich:calendar only work class Date.

          When I submit form, always the exception occurs:

          
          [0.0-8080-1] ERROR b].[localhost].[/amplis].[Faces Servlet] [] - Servlet.service() for servlet Faces Servlet threw exception
          java.lang.ClassCastException: com.base.datetime.MyCalendar
           at org.richfaces.renderkit.CalendarRendererBase.getSelectedDate(CalendarRendererBase.java:356)
           at org.richfaces.renderkit.html.CalendarRenderer.doEncodeEnd(CalendarRenderer.java:218)
           at org.richfaces.renderkit.html.CalendarRenderer.doEncodeEnd(CalendarRenderer.java:427)
           at org.ajax4jsf.renderkit.RendererBase.encodeEnd(RendererBase.java:135)
           at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:539)
           at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:286)
           at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
           at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:284)
           at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
           at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:284)
           at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
           at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:284)
           at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:143)
           at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:86)
           at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:134)
           at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:86)
           at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:134)
           at org.ajax4jsf.renderkit.AjaxContainerRenderer.encodeAjax(AjaxContainerRenderer.java:122)
           at org.ajax4jsf.component.AjaxViewRoot.encodeAjax(AjaxViewRoot.java:555)
           at org.ajax4jsf.context.AjaxContextImpl.renderAjaxRegion(AjaxContextImpl.java:289)
           at org.ajax4jsf.context.AjaxContextImpl$2.invoke(AjaxContextImpl.java:204)
           at org.ajax4jsf.context.JsfOneOneInvoker.invokeOnComponent(JsfOneOneInvoker.java:78)
           at org.ajax4jsf.context.AjaxContextImpl.invokeOnComponent(AjaxContextImpl.java:160)
           at org.ajax4jsf.context.AjaxContextImpl.renderSubmittedAjaxRegion(AjaxContextImpl.java:218)
           at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:239)
           at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
           at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
          
          


          somebody could help me?


          My suggestion is that the rich:calendar accepted Dates and Calendar in the value, and not only Dates.

          This is possible??


          • 3. Re: Suggestion about calendar ClassCastException...
            Ronan Silva Newbie

            Thank's a lot... nbelaevski...

            :)