From the error message, it sounds like Spring is attempting to instantiate the object with this constructor:
public M2000AlarmChannel(String host, int port, String username, String password, MDDComponent componenet)
Looks like Spring is confused on which constructor to use, possibly because both constructors have a MDDComponent
parameter (in a way, both constructors have this as their last parameter, I'm curious if that has something to do with the logic that Spring uses in determining which constructor to use. Anyway...).
According to the Spring manual, there are parameters you can add to the <constructor-arg>
element to help the container resolve which constructor to use:
You can add "type":
<bean id="exampleBean" class="examples.ExampleBean">
<constructor-arg type="int" value="7500000"/>
<constructor-arg type="java.lang.String" value="42"/>
</bean>
or you can add an index:
<bean id="exampleBean" class="examples.ExampleBean">
<constructor-arg index="0" value="7500000"/>
<constructor-arg index="1" value="42"/>
</bean>
(You can probably specify both, if you really want to)
Adding one or both of these should help Spring resolve which constructor to use.
As a corollary, if this doesn't help, can you simply change the XML definition to pass in the parameters required for the other constructor, the one Spring is attempting to use?
BTW, it might make your question a lot more readable to use the quote tags within WMD.