【问题标题】:Camel Bindy application JBoss EAP 6.1 Deployment issueCamel Bindy 应用程序 JBoss EAP 6.1 部署问题
【发布时间】:2017-09-16 08:47:51
【问题描述】:

我正在尝试部署一个读取 CSV 文件并对其进行处理的骆驼应用程序。我正在尝试使用骆驼绑定将 csv 解组为 POJO。 jboss EAP中没有camel bindy模块,我已经添加了它。

骆驼路线:

<?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”。确保数据格式有效且关联的 Camel 组件存在于类路径中

附加 server.log

你能帮忙吗

【问题讨论】:

    标签: csv apache-camel jbossfuse jboss-eap-6 switchyard


    【解决方案1】:

    听起来您可能正在使用 JBoss FSW? EAP 6.3 上的 Fuse 6.3 包括 camel-bindy,如果您可以升级,这里还包含一个用于 SwitchYard 的示例。

    【讨论】:

    • 嗨汤姆,是的,我正在使用 FSW 6.0。我已经发布了答案。
    【解决方案2】:

    请看;

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

    确保您已创建 bindyDataFormat

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

    【讨论】:

      【解决方案3】:

      参考链接https://developer.jboss.org/thread/177124.I后,在maven jar plugin pom xml中添加了manifest条目

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

      我现在能够使用骆驼绑定将其解组为 pojo。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-12-29
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-10-30
        • 2013-12-29
        • 2018-09-08
        • 2018-11-19
        相关资源
        最近更新 更多