2017-09-16 189 views
0

我想部署一个读取CSV文件并处理它的骆驼应用程序。我试图用骆驼bindy来将csv解组到POJO。 骆驼bindy模块在jboss EAP中不可用,我添加了它。Camel Bindy应用程序JBoss EAP 6.1部署问题

骆驼路线:

<?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> 

荫部署过程中得到以下例外。

引起:java.lang.IllegalArgumentException:无法创建数据格式'bindy-csv'。确保数据格式是有效的和相关的骆驼成分存在于类路径

附加的server.log

能否请你帮

回答

0

闯民宅链接https://developer.jboss.org/thread/177124.I后添加在Maven的Jar插件POM XML清单项

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

亚姆能够解组,现在使用的骆驼bindy到POJO。

0

请参阅;

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

确保你已经创建bindyDataFormat

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

1

这听起来像你可能使用JBoss FSW? EAP 6.3上的保险丝6.3包括骆驼绑定,并且如果您可以升级,那么SwitchYard也包含一个例子。

+0

嗨汤姆,是我使用FSW 6.0.I已发布答案。 – Ravi