Hi

Do you need to use xmlbeans? I would suggest to try out JAXB or XStream instead.


On Fri, Jul 16, 2010 at 11:20 AM, Nav <[email protected]> wrote:
>
> Hi,
>     I am using XMLBeans in my route for marshalling an object into XML.  I
> get the following error.
> SEVERE: Caused by: [org.apache.camel.NoTypeConversionAvailableException - No
> type converter available to convert from type: java.util.HashMap to the
> required type: org.apache.xmlbeans.XmlObject
>
>  In the DTO there is HashMap field, which requires a type converter.
>
>
> @XmlRootElement(name = "ShippingConditions")
> @XmlAccessorType(XmlAccessType.PROPERTY)
> public class ShippingConditionMapDTO {
>
>    Map<String,List<ShippingCondition>> shippingConditionMap = new
> HashMap<String, List<ShippingCondition>>();
>
>
>    public Map<String, List<ShippingCondition>> getShippingConditionMap() {
>        return shippingConditionMap;
>    }
>
>    public void setShippingConditionMap(Map<String, List<ShippingCondition>>
> shippingConditionMap) {
>        this.shippingConditionMap = shippingConditionMap;
>    }
> }
>
>  The route is as follows.  The Processor returns an instance of the DTO
> mentioned above.
>
>  <route>
>           <from uri="{{CSVFileFolder}}"/>
>            <convertBodyTo type="java.lang.String"/>
>            <process ref="shippingConditionProcessor"/>
>            <marshal><xmlBeans/></marshal>
>            <convertBodyTo type="java.lang.String"/>
>            <setHeader headerName="CamelHttpMethod">
>                <constant>POST</constant>
>            </setHeader>
>            <setHeader headerName="Content-Type">
>                <constant>application/xml</constant>
>            </setHeader>
>          <to uri="http://testserver/shippingCondition"/>
>         </route>
>
> How can I specify typeconverter for this ?
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/org-apache-camel-NoTypeConversionAvailableException-No-type-converter-available-to-convert-from-typet-tp1223953p1223953.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to