While applications starts I'm getting following warning messages (dozens of times):
Dec 08, 2012 5:10:41 PM org.springframework.beans.TypeConverterDelegate findDefaultEditor
WARNING: PropertyEditor [sun.beans.editors.EnumEditor] found through deprecated global PropertyEditorManager fallback - consider using a more isolated form of registration, e.g. on the BeanWrapper/BeanFactory!
Google shows that it's very common message, but unfortunatelly doesn't show why it happens. How can I avoid these warnings?
Spring version 2.5.6.
Adding custom editor fixed warning:
public final class EnumPropertyEditor extends PropertyEditorSupport {
public EnumPropertyEditor() {
}
@Override
public String getAsText() {
return (String) getValue();
}
@Override
public void setAsText(String text) throws IllegalArgumentException {
setValue(text);
}
}
In config:
<bean class="org.springframework.beans.factory.config.CustomEditorConfigurer">
<property name="customEditors">
<map>
<entry key="java.lang.Enum">
<bean class="package.EnumPropertyEditor">
</bean>
</entry>
</map>
</property>
</bean>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With