I ran into the following error on G 2.0.1 with Spring versions
2.0.5-2.0.7-SNAPSHOT. PropertyEditor.setValue() is being called with
an object whose type does not match the defined type.
15:54:12,596 ERROR [ContextLoader] Context initialization failed
org.springframework.beans.factory.access.BootstrapException: Unable
to initialize group definition. Group resource name
[classpath*:beanRefContext.xml], factory key [ear.context]; nested
exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'ear.context' defined in URL [jar:file:/
Users/kevan/Desktop/geronimo-tomcat6-jee5-2.0.1/repository/org/spring/
example/MultipleContexts/1.0/MultipleContexts-1.0.ear/lib/
SampleJava.jar!/beanRefContext.xml]: Instantiation of bean failed;
nested exception is
org.apache.xbean.propertyeditor.PropertyEditorException: Value is not
an instance of String
Caused by:
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'ear.context' defined in URL [jar:file:/Users/
kevan/Desktop/geronimo-tomcat6-jee5-2.0.1/repository/org/spring/
example/MultipleContexts/1.0/MultipleContexts-1.0.ear/lib/
SampleJava.jar!/beanRefContext.xml]: Instantiation of bean failed;
nested exception is
org.apache.xbean.propertyeditor.PropertyEditorException: Value is not
an instance of String
Caused by:
org.apache.xbean.propertyeditor.PropertyEditorException: Value is not
an instance of String
at org.apache.xbean.propertyeditor.AbstractConverter.setValue
(AbstractConverter.java:67)
at org.springframework.beans.TypeConverterDelegate.doConvertValue
(TypeConverterDelegate.java:276)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary
(TypeConverterDelegate.java:192)
<snip>
Spring has been updated in latest builds to ignore this problem (see
http://opensource.atlassian.com/projects/spring/browse/SPR-3799).
There's some question about what the proper behavior is in this
case... I didn't find any spec-level guidance... http://
weblogs.java.net/blog/ljnelson/archive/2007/08/objects_and_str.html
(search for 'dilemma') recommends logging the condition and ignoring
the type mismatch.
This pretty much exhausts my knowledge of the subject. Any thoughts
on being a little less dogmatic and ignoring the type mismatch?
--kevan