|
From: 452 - B. P. <bu...@ct...> - 2004-09-14 13:19:55
|
Dear list, I've been working with an error on a constructor argument in the bean container. Spring seems to have problems with a primitive boolean <constructor-arg> in a <bean> as in: <constructor-arg><value>true</value></constructor-arg> But this is the way to go right? It says so in the Spring ref. The error I get is this: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'customDateEditor' defined in resource [/WEB-INF/applicationContext.xml] of ServletContext: Unsatisfied dependency expressed through constructor argument with index 1 of type [boolean]: Did you specify the correct bean references as generic constructor arguments? The other arg is a SimpleDateFormat, here the whole definition. <bean id=3D"customEditorConfigurer" class=3D"org.springframework.beans.factory.config.CustomEditorConfigurer"= > <property name=3D"customEditors"> <map> <entry key=3D"java.util.Date"><ref local=3D"customDateEditor"/></entry> </map> </property> </bean> <bean id=3D"customDateEditor" class=3D"org.springframework.beans.propertyeditors.CustomDateEditor"> <constructor-arg><ref local=3D"dateFormatSql"/></constructor-arg> <constructor-arg><value>true</value></constructor-arg> </bean> <bean id=3D"dateFormatSql" class=3D"java.text.SimpleDateFormat"> =09 <constructor-arg><value>yyyy-MM-dd</value></constructor-arg> </bean> The obvious goal here is simply to get a CustomDateEditor registered. Thank ahead! Paul. |