my dog learned polymorphism
The moose likes Other Application Frameworks and the fly likes CustomEditorConfigurer Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "CustomEditorConfigurer Exception" Watch "CustomEditorConfigurer Exception" New topic

CustomEditorConfigurer Exception

S Dave
Ranch Hand

Joined: Jan 28, 2001
Posts: 103
Could you please point out why I get the following exception while trying to use CustomEditorConfigurer? Thanks in advance for your time.

org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.util.Date] for property 'dt'; nested exception is java.lang.IllegalArgumentException: No matching editors or conversion strategy found
Caused by: java.lang.IllegalArgumentException: No matching editors or conversion strategy found

My configuration file contains the following:

<bean id="customEditorConfigurer" class="org.springframework.beans.factory.config.CustomEditorConfigurer">
<property name="customEditors">
<entry key="java.util.Date">
<bean class="MyDateEditor"></bean>

My property editor is defined below:

public class MyDateEditor extends PropertyEditorSupport
private String dt;
public void setAsText(String text) throws IllegalArgumentException
this.dt = text;
Date dtobj= new Date(dt);

My Bean class

public class Story
private String title;
private String author;
private String content;
private Date dt;
//accessors for other fields go here...
public Date getDt()
return dt;
public void setDt(Date dt)
this.dt = dt;
I agree. Here's the link:
subject: CustomEditorConfigurer Exception
It's not a secret anymore!