Title: RE: Problem with Date Conversion with 1.1.1 release - release bug??

Issue created at http://issues.apache.org/jira/browse/MYFACES-796

Looking the source, I see the problem in class org.apache.myfaces.el.ValueBindingImpl , before 1.1.1, in the setValue(FacesContext facesContext, Object newValue) method, the call to the propertyResolver.setValue is in this way :

                    Class clazz = propertyResolver.getType(base, property);
                    propertyResolver.setValue(base, property, coerce(newValue, clazz));

In the 1.1.1, this has changed to :

                   propertyResolver.setValue(base, property, newValue);

This change is causing the error.

Thanks Martin.

Rogerio

-----Original Message-----
From: Martin Marinschek [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 07, 2005 9:35 PM
To: MyFaces Discussion
Subject: Re: Problem with Date Conversion with 1.1.1 release - release bug??

Please open an issue in our issue tracker for this.

http://myfaces.apache.org/issue.html

regards,

Martin

On 11/7/05, Rogerio Saulo (P) <[EMAIL PROTECTED]> wrote:
>
> Hi All,
>
> I have an custom Date converter that works well with all version of
> MyFaces until 1.1.1, When I upgrade from 1.1.0 to 1.1.1 my custom
> converter stop working.
> In my page when the user does not fill the date field, that is not
> required myfaces report the following error, the field in backing bean
> is of type java.util.Date.
>
> The Bean :
>
> ----------------------------------------------------------------------
> ----------------------------------------------------------------------
> ----------------------------------------------------------------------
> -------------------
>
> public class UserSearchBean extends BaseSearchBean {
>
>  private Integer id_user;
>  private String email;
>  private String login;
>  private String name;
>  private Date creation_timestamp1;
>
>  public Date getCreation_timestamp1() {
>   return creation_timestamp1;
>  }
>
>  public void setCreation_timestamp1(Date creation_timestamp1) {
>   this.creation_timestamp1 = creation_timestamp1;  }
>
> ...
>
> The Page :
>
> ----------------------------------------------------------------------
> ----------------------------------------------------------------------
> ----------------------------------------------------------------------
> -------------------
>
>
> <h:inputText id="txtDateCreation"
> value="#{UserSearchBean.creation_timestamp1}"
> maxlength="10" size="9" styleClass="input">
>
> <venus:dateTimeConverter pattern="DD/MM/YYYY" />
>
> </h:inputText>
>
> The Converter :
> ----------------------------------------------------------------------
> ----------------------------------------------------------------------
> ----------------------------------------------------------------------
> -------------------
>
>  public Object getAsObject(FacesContext context, UIComponent
> component, String newValue)
>    throws ConverterException {
>
>   Date convertedValue = null;
>
>   boolean valid = false;
>
>   if ( newValue == null || newValue.equals("") ) {
>    return newValue;
>   }
>
>   SimpleDateFormat fmt = new SimpleDateFormat(pattern);
>   fmt.setLenient(false);
>
>   try {
>
>    convertedValue = fmt.parse(newValue);
>    valid = true;
>
>   } catch (ParseException e) {
>
>    valid = false;
>
>   }
>
>
>   if ( !valid ) {
>    FacesMessage errMsg = MessageFactory.getMessage(context,
> DATETIME_FORMAT_INVALID_MESSAGE_ID,
>     (new Object[] {newValue}));
>    throw new ConverterException(errMsg);
>   }
>
>   return convertedValue;
>
>  }
>
>
> The Error :
> ----------------------------------------------------------------------
> ----------------------------------------------------------------------
> ----------------------------------------------------------------------
> -------------------
>
>
> [2005-11-07 09:29:16,546] http-8080-Processor24
> org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/venusw
> eb] ERROR - Cannot set value for _expression_
> '#{UserSearchBean.creation_timestamp1}' to a new value of type
> java.lang.String
>
>
> javax.faces.el.EvaluationException: Cannot set value for _expression_
> '#{UserSearchBean.creation_timestamp1}' to a new value of type
> java.lang.String
>
> at
> org.apache.myfaces.el.ValueBindingImpl.setValue(ValueBindingImpl.java:
> 304)
>
> at
> javax.faces.component.UIInput.updateModel(UIInput.java:226)
>
> at
> javax.faces.component.UIInput.processUpdates(UIInput.java:165)
>
> at
> javax.faces.component.UIForm.processUpdates(UIForm.java:85)
>
> at
> javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.j
> ava:428)
>
> at
> javax.faces.component.UIViewRoot.processUpdates(UIViewRoot.java:153)
>
> at
> org.apache.myfaces.lifecycle.LifecycleImpl.updateModelValues(Lifecycle
> Impl.java:277)
>
> at
> org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:
> 81)
>
> at
> javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli
> cationFilterChain.java:252)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi
> lterChain.java:173)
>
> at
> br.com.venus.view.filters.SecurityFilter.doFilter(SecurityFilter.java:
> 61)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli
> cationFilterChain.java:202)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi
> lterChain.java:173)
>
> at
> org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(Exten
> sionsFilter.java:122)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli
> cationFilterChain.java:202)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi
> lterChain.java:173)
>
> at
> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doF
> ilterInternal(OpenSessionInViewFilter.java:172)
>
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRe
> questFilter.java:76)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli
> cationFilterChain.java:202)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi
> lterChain.java:173)
>
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVa
> lve.java:213)
>
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextVa
> lve.java:178)
>
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.ja
> va:126)
>
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.ja
> va:105)
>
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValv
> e.java:107)
>
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
> :148)
>
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
> 856)
>
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proces
> sConnection(Http11Protocol.java:744)
>
> at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoi
> nt.java:527)
>
> at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFoll
> owerWorkerThread.java:80)
>
> at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPo
> ol.java:684)
>
> at java.lang.Thread.run(Thread.java:595)
>
> Caused by: javax.faces.el.EvaluationException:
> br.com.venus.model.bean.search.UserSearchBean
>
> at
> org.apache.myfaces.el.PropertyResolverImpl.setValue(PropertyResolverIm
> pl.java:155)
>
> at
> org.apache.myfaces.el.ValueBindingImpl.setValue(ValueBindingImpl.java:
> 269)
>
> ... 32 more
>
> Caused by: javax.faces.el.EvaluationException: Bean:
> br.com.venus.model.bean.search.UserSearchBean, property:
> creation_timestamp1
>
> at
> org.apache.myfaces.el.PropertyResolverImpl.setProperty(PropertyResolve
> rImpl.java:372)
>
> at
> org.apache.myfaces.el.PropertyResolverImpl.setValue(PropertyResolverIm
> pl.java:148)
>
> ... 33 more
>
> Caused by: java.lang.IllegalArgumentException: argument type mismatch
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
>
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
> ava:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> orImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:585)
>
> at
> org.apache.myfaces.el.PropertyResolverImpl.setProperty(PropertyResolve
> rImpl.java:368)
>
> ... 34 more
>
> But I do not see this behavior with all prior version.
>
> Is that a bug in the new release??
>
> Anyone see this same behavior??
>
> Thanks.
>
>
>
>
> "Essa mensagem é destinada exclusivamente ao seu destinatário e pode
>
> conter informações confidenciais, protegidas por sigilo profissional
> ou
>
> cuja divulgação seja proibida por lei. O uso não autorizado de tais
>
> informações é proibido e está sujeito às penalidades cabíveis.
>
>
> This message is intended exclusively for its addressee and may contain
>
> information that is confidential and protected by a professional
>
> privilege or whose disclosure is prohibited by law. Unauthorized use
> of
>
> such information is prohibited and subject to applicable penalties."


--

http://www.irian.at
Your JSF powerhouse -
JSF Trainings in English and German



"Essa  mensagem é  destinada  exclusivamente ao seu destinatário e pode
conter informações confidenciais, protegidas por sigilo profissional ou
cuja  divulgação  seja  proibida por  lei. O uso não autorizado de tais
informações  é   proibido  e  está   sujeito  às  penalidades cabíveis.

This message is intended exclusively for its addressee and may  contain
information that  is  confidential  and  protected  by  a  professional
privilege or whose disclosure is prohibited by law. Unauthorized use of
such  information is  prohibited and subject to  applicable penalties."

Reply via email to