Here, the first argument will be matched to the first parameter of each method and then the parameter will be matched.
I would suggest the solution below to help remove ambiguity
If you want to call your first constructor use
<bean id="triangle" class="org.tester.Triangle">
<constructor-arg type="int" ?value="20" />
<constructor-arg type="java.lang.String" ?value="10" />
</bean>
If you want to call your second constructor use
<bean id="triangle" class="org.tester.Triangle">
<constructor-arg type="java.lang.String"value="20" />
<constructor-arg type="int" value="10" />
</bean>
So that resolves the ambiguity
EDIT :-
Please read more about this problem here.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…