1 Reply Latest reply on Jun 11, 2008 10:39 PM by Gabriella Turek

    Probelems setting rich:calendar timezone from backing bean

    Gabriella Turek Newbie

      I thought this would be as simple as implementing
      public TimeZone getTimeZone()
      {
      return TimeZone.getDefault(); //For testing purposes keep it simple
      }

      in the backing bean, but I keep getting the following error:

      SEVERE: Error Rendering View[/absenceBook.xhtml]
      java.lang.NullPointerException
      at java.util.GregorianCalendar.computeFields(Unknown Source)
      at java.util.GregorianCalendar.computeFields(Unknown Source)
      at java.util.Calendar.setTimeInMillis(Unknown Source)
      at java.util.GregorianCalendar.(Unknown Source)
      at java.util.Calendar.createCalendar(Unknown Source)
      at java.util.Calendar.getInstance(Unknown Source)
      at org.richfaces.component.UICalendar.getCurrentDateOrDefault(UICalendar.java:300)
      at org.richfaces.renderkit.html.CalendarRenderer.doEncodeEnd(CalendarRenderer.java:371)
      at org.richfaces.renderkit.html.CalendarRenderer.doEncodeEnd(CalendarRenderer.java:483)
      at org.ajax4jsf.renderkit.RendererBase.encodeEnd(RendererBase.java:135)
      at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:836)
      at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:286)
      at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
      at org.ajax4jsf.renderkit.html.AjaxOutputPanelRenderer.encodeChildren(AjaxOutputPanelRenderer.java:79)
      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
      at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:271)
      at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:117)
      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
      at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:271)
      at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:242)
      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
      at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:271)
      at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:242)
      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
      at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:282)
      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.richfaces.renderkit.html.ModalPanelRenderer.doEncodeChildren(ModalPanelRenderer.java:397)
      at org.richfaces.renderkit.html.ModalPanelRenderer.doEncodeChildren(ModalPanelRenderer.java:392)
      at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:121)
      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
      at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:282)
      at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
      at org.ajax4jsf.renderkit.html.AjaxOutputPanelRenderer.encodeChildren(AjaxOutputPanelRenderer.java:79)
      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
      at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:282)
      at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:125)
      at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:68)
      at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:116)
      at org.ajax4jsf.renderkit.AjaxContainerRenderer.encodeAjax(AjaxContainerRenderer.java:123)
      at org.ajax4jsf.component.AjaxViewRoot.encodeAjax(AjaxViewRoot.java:641)
      at org.ajax4jsf.component.AjaxViewRoot.encodeChildren(AjaxViewRoot.java:512)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
      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:189)
      at



      etc, etc, What is going wrong?
      Thanx

        • 1. Additional comments
          Gabriella Turek Newbie

          We finally got it to work. The getTimeZone() method was actually in an
          abstract superclass. We removed the abstract qualifier, listed the class in
          the faces-config.xml file and directly referenced it in the xhtml page.
          But we do not understand why this way works, and not the other. Any clues?
          Thanx