myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leonardo Uribe" <lu4...@gmail.com>
Subject Re: IllegalArgumentException using t:inputCalendar
Date Tue, 09 Sep 2008 00:00:52 GMT
On Mon, Sep 8, 2008 at 4:02 PM, Fernando Madruga Pinheiro <
fpinheiro@wmixvideo.com.br> wrote:

> Hi,
> I'm trying hard to solve this problem, but no success. Anyone else is
> getting the same?
> When setting renderAsPopup="false" it works.
>
> But we really need to render it as popup... tried today 1.1.7-SNAPSHOT and
> 1.1.8-SNAPSHOT, both without sucess.
>

The problem you presented seems to be related to
org.apache.myfaces.dateformat.SimpleDateFormatter.

This class was introduced after 1.1.6, and it is used by
HtmlCalendarRenderer.CalendarDateTimeConverter.

If you set instances of java.sql.Date to t:inputCalendar, this class does
not handle time fields, resulting in an error. Maybe you could try use real
java.util.Date (note that java.sql.Date extends from java.util.Date).

Or you can provide a custom converter (it should implement
HtmlCalendarRenderer.DateConverter interface).


>
> Best regards,
> Fernando
>
> Iniciar mensagem reenviada:
>
> *De: *Fernando Madruga Pinheiro <>
> *Data: *2 de setembro de 2008 18h10min18s GMT-03:00
> *Para: *dev@myfaces.apache.org
> *Assunto: **IllegalArgumentException using t:inputCalendar*
>
> Hi,
> I'm using tomahawk12-1.1.7-SNAPSHOT, since we are migrating to JSF 1.2, and
> where we use t:inputCalendar we get an IllegalArgumentException.
>
> 02/09/2008 18:02:32 com.sun.faces.lifecycle.Phase doPhase
> SEVERE: JSF1054: (Phase ID: RENDER_RESPONSE 6, View ID:
> /cadastrorepresentante/cadastrorepresentante.jsp) Exception thrown during
> phase execution:
> javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@982f37
> ]
> 02/09/2008 18:02:32 org.apache.catalina.core.StandardWrapperValve invoke
> SEVERE: Servlet.service() for servlet Faces Servlet threw exception
> java.lang.IllegalArgumentException
> at java.sql.Date.getHours(Date.java:156)
> at org.apache.myfaces.dateformat.SimpleDateFormatter.formatOps(
> SimpleDateFormatter.java:835)
> at org.apache.myfaces.dateformat.SimpleDateFormatter.format(
> SimpleDateFormatter.java:1203)
> at
> org.apache.myfaces.custom.calendar.HtmlCalendarRenderer$CalendarDateTimeConverter.getAsString(
> HtmlCalendarRenderer.java:1183)
> at org.apache.myfaces.custom.calendar.HtmlCalendarRenderer.renderPopup(
> HtmlCalendarRenderer.java:197)
> at org.apache.myfaces.custom.calendar.HtmlCalendarRenderer.encodeEnd(
> HtmlCalendarRenderer.java:148)
> at javax.faces.component.UIComponentBase.encodeEnd(
> UIComponentBase.java:861)
> (...)
>
>
> I've downloaded the sources and attached to my project, so I can debug to
> the error line:
>
>         context.hour = date.getHours();
>
> And when it tries to call getHours() throws the exception.
>
> I have tried to change from java.sql.Date to java.util.Date and the error
> persists. Changing from t:inputCalendar to t:inputDate works well.
>
> Anyone else is having the same problem?
>
> This page was working with tomahawk 1.1.6.
>
> Regards,
> Fernando Madruga Pinheiro
>
>
>

Mime
View raw message