As a workaround I'm trying to map a Map<String, String> in as an argument to
the constructor but I'm getting the following exception:
Caused by: java.lang.InstantiationException: unable to find matching public
constructor for class: User with argument types:
org.exolab.castor.mapping.MapItem
        at
org.exolab.castor.util.DefaultObjectFactory.instantiateUsingConstructor(DefaultObjectFactory.java:139)

This is the relevant portion of my mapping file:

<class name="User" auto-complete="true">
        <field name="allStrings" collection="map" set-method="%1">
                <bind-xml node="attribute" name="allStrings">
                        <class name="org.exolab.castor.mapping.MapItem">
                                <field name="key" type="java.lang.String">
                                        <bind-xml name="name" node="attribute"/>
                                </field>
                                <field name="value" type="java.lang.String">
                                        <bind-xml name="value" node="element"/>
                                </field>
                        </class>
                </bind-xml>
        </field>
</class>

and here is the xml I'm trying to unmarshal:
<User>
        <allStrings key="somekey">
                <value>akey1</value> 
        </allStrings>  
</User>

Is it currently possible to map a constructor which takes a Map as an
argument?



darrickc wrote:
> 
> Is there really a limit to the number of arguments allowed when mapping a
> constructor? It seems very limiting to only allow up to 9 arguments when
> mapping a constructor. Please tell me this isn't true.
> 

-- 
View this message in context: 
http://www.nabble.com/Mapping-constructor-arguments-exception-when-mapping-more-than-9-arguments-tp22728174p22731173.html
Sent from the Castor - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to