【问题标题】:Using parameter bind anotations @properties is null使用参数绑定注释 @properties 为 null
【发布时间】:2017-11-27 16:19:04
【问题描述】:

我使用参数绑定注释@Properties 作为参数,它为空。交换属性未绑定到参数。

骆驼版:2.17

容器:Jboss EAP 6.4

骆驼豆定义:

 <bean id="_bean1"
                method="methodA('serviceName')" ref="eventLogger"/>

Java方法定义:

public void methodA(String eventName,@Properties Map<String, Object> properties) {

        //do something;
    }

你能帮忙解决这个问题吗

【问题讨论】:

  • 我没有发现您的代码有任何问题。应该管用。 eventLogger 的定义是什么?我之前使用模拟端点和@Properties 绑定似乎出错了。您是否正在使用模拟进行测试?如果是肯定的,请尝试不使用它。

标签: java spring apache-camel jbossfuse


【解决方案1】:

我发现了问题。我已经将war与依赖库一起打包,它有一个camel core的副本。调用类被创建为一个模块,并作为提供的war包的依赖添加。它正在加载camel单独的核心类。在从自定义模块和系统模块中引用骆驼核心后,它工作正常。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-08-05
    • 1970-01-01
    • 2012-12-01
    • 1970-01-01
    • 2013-01-24
    • 2020-01-31
    • 2012-12-23
    • 1970-01-01
    相关资源
    最近更新 更多