0
votes

I am trying to deploy a camel application which reads CSV file and process it.I am trying to use camel bindy to unmarshal the csv to POJO. The camel bindy module was not available in jboss EAP i have added it.

Camel Route:

<?xml version="1.0" encoding="ASCII"?>
<routes xmlns="http://camel.apache.org/schema/spring">
    <route>
        <from uri="switchyard://FileService" />
        <log message="inside route" />
        <doTry>
            <split streaming="true">
                <tokenize token="/n"></tokenize>

                <unmarshal ref="bindyDataformat" >
                    <bindy classType="com.agcs.bih.prototypes.filetosca.Student" type="Csv"/>
                </unmarshal>
                <process ref="ProcessCSV"></process>
            </split>

            <doCatch>

                <exception>java.lang.Exception</exception>
                <log message="FileToScaRoute - message received: ${exception.message}" />

            </doCatch>
        </doTry>
    </route>
</routes>

Iam getting the below exception during deployment.

Caused by: java.lang.IllegalArgumentException: Data format 'bindy-csv' could not be created. Ensure that the data format is valid and the associated Camel component is present on the classpath

Attaching server.log

Can you please help

3

3 Answers

1
votes

It sounds like you are using JBoss FSW possibly? Fuse 6.3 on EAP 6.3 includes camel-bindy and there's an example included there for SwitchYard as well if you can upgrade.

0
votes

Please see;

http://camel.apache.org/bindy.html

Make sure you have created bindyDataFormat

<dataFormats> <bindy id="bindyDataformat" type="Csv" classType="org.apache.camel.bindy.model.Order"/> </dataFormats>

0
votes

After refering the link https://developer.jboss.org/thread/177124.I have added the manifest entry in maven jar plugin pom xml

<manifestEntries>                           
<Dependencies>org.apache.camel.bindy export services</Dependencies>
</manifestEntries> 

iam able to unmarshal it to pojo using camel bindy now.