Hi All,

I have below binding.xml :

<binding>
        <mapping class="wroxaxis.appendixb.Forecast" name="forecast">
                <value name="state" field="state" usage="optional"/>
                <value name="zip" field="zip" usage="optional"/>
                <value name="precip" field="precip" usage="optional"/>
                <value name="date" field="date" usage="optional"/>
                <value name="hi" field="hi" usage="optional"/>
                <value name="city" field="city" usage="optional"/>
                <value name="forecast" field="forecast" usage="optional"/>
                <value name="low" field="low" usage="optional"/>
                <structure field="temp" name="temperature" >
                        <value name="temp" field="temp" />
                </structure>
                <structure field="hashMap" />
                <collection field="dummyVector" usage="optional">
                        <value style="element" name="vectorElement" />
                </collection>           
        </mapping>
        <mapping name="customer" class="Customer" value-style="attribute">
                <value name="street" field="street" style="element"/>
                <value name="city" field="city" style="element"/>
                <value name="state" field="state"/>
                <value name="zip" field="zip"/>
        </mapping>
        <mapping class="java.util.HashMap" name="map" marshaller="HashMapper"
unmarshaller="HashMapper"/>
</binding>




JibxClient.java
--------------------
IMarshallingContext mctx = bfact.createMarshallingContext();

Forecast forecastObj = new Forecast();
...
HashMap hashMap = new HashMap();
...
Customer customer = new Customer();
customer.setStreet("JAMMI");
customer.setCity("VZA");
customer.setState("AP");
...
hashMap.put("a", "b");
...
forecastObj.setHashMap(hashMap);
...
mctx.setIndent(4);
mctx.marshalDocument(forecastObj, "UTF-8", null, new
FileOutputStream("data.xml"));



When I run my above client program JibxClient.java I am getting below error :

org.jibx.runtime.JiBXException: Invalid object type for marshaller
        at HashMapper.marshal(HashMapper.java:84)
        at wroxaxis.appendixb.Forecast.JiBX_binding_marshal_2_1(Forecast.java)
        at wroxaxis.appendixb.JiBX_bindingForecast_access.marshal()
        at wroxaxis.appendixb.Forecast.marshal(Forecast.java)
        at 
org.jibx.runtime.impl.MarshallingContext.marshalRoot(MarshallingContext.java:919)
        at 
org.jibx.runtime.impl.MarshallingContext.marshalDocument(MarshallingContext.java:967)
        at JibxClient.main(JibxClient.java:74)
        
        
        
Can anyone please tell me what am I missing here ?



Thanks & Regards,
Kumar.


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to