aspose file tools*
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
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "CustomEditorConfigurer Exception" Watch "CustomEditorConfigurer Exception" New topic
Author

CustomEditorConfigurer Exception

S Dave
Ranch Hand

Joined: Jan 28, 2001
Posts: 103
Hi
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">
<map>
<entry key="java.util.Date">
<bean class="MyDateEditor"></bean>
</entry>
</map>
</property>
</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);
setValue(dtobj);
}
}

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: http://aspose.com/file-tools
 
subject: CustomEditorConfigurer Exception