Spring beans: ambiguous constructor when creating a bean -
first, apologize if has been answered elsewhere, @ loss how resolve error.
i have bean declaration as:
<bean id="prefix" class="java.lang.string"> <constructor-arg index="0"> <value>uio</value> </constructor-arg> </bean>
from defaultlistablebeanfactory, message printed:
creating shared singleton instance of instance of singleton bean 'prefix'.
after further messages, defaultlistablebeanfactory
prints message:
ignoring constructor [public java.lang.string(byte..,int,int,java.nio.charset.charset .. then: unsatisifed dependency expressed through constructor argument index 1 of type[int]: ambiguous constructor.
i searched through web , saw similar type of question has been asked , answered few times, trying determine definitive answer is.
i tried following declarations:
<bean id="prefix" class="java.lang.string"> <constructor-arg index="0" type="string"> <value>uio</value> </constructor-arg> </bean> <bean id="prefix" class="java.lang.string"> <constructor-arg index="0"> <value>"uio"</value> </constructor-arg> </bean>
to no avail.
i sure answer relatively simple , missing syntactic specification, have been unable find definitive syntactic structure work consistently.
any appreciated. guidance documentation of great help.
try
<bean id="prefix" class="java.lang.string"> <constructor-arg type="java.lang.string" value="uio"/> </bean>
Comments
Post a Comment