Feb 3rd, 2005, 04:57 PM
TypeMismatchException - java.lang.Character
I'm attempting to configure a bean within spring using the following bean definition where 'entryIndicator' is defined as a java.lang.Character instance variable on com.test.EntryBean, with the necessary getter/setter:
<bean id="docTypeBean0" class="com.test.EntryBean">
Although, when loading this context file into the ApplicationContext, I am receiving the exception:
org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.lang.Character] for property 'entryIndicator'
Any ideas how I can explicitly define 'entryIndicator' as a java.lang.Character rather than a String?
Feb 4th, 2005, 02:28 AM
As far as I am aware there is no PropertyEditor in Spring for doing this nor is there default suppotrt by JavaBeans. You can create your own PropertyEditor and then register it with CustomEditorConfigurer.
Check the JavaDocs for CustomEditorConfigurer and have a look at the code for some of the PropertyEditor supplied with Spring.