Java SpringDSL中的Apache驼峰bean参数绑定问题
我在Apache Camel和Spring DSL方面遇到了一个奇怪的问题。以下是我的Spring定义路线的摘录:Java SpringDSL中的Apache驼峰bean参数绑定问题,java,spring,apache-camel,Java,Spring,Apache Camel,我在Apache Camel和Spring DSL方面遇到了一个奇怪的问题。以下是我的Spring定义路线的摘录: <route> <from uri="direct:process-xml"/> <setHeader headerName="documentRootOid"> <method bean="foo.bar.util.TranslatorUtil" method=&
<route>
<from uri="direct:process-xml"/>
<setHeader headerName="documentRootOid">
<method bean="foo.bar.util.TranslatorUtil" method="extractDocumentRootOid"/>
</setHeader>
<setHeader headerName="organization">
<method bean="foo.bar.util.OrgServices" method="getOrganizationByOid(*,${header.documentRootOid})"/>
</setHeader>
<setHeader headerName="organizationStyleSheet">
<method bean="foo.bar.util.TranslatorUtil" method="extractStyleSheetAttributeFromOrganization(*,${header.organization})"/>
</setHeader>
<bean beanType="foo.bar.util.Utils" method="transformBodyUsingStyleSheet(*,${header.organizationStyleSheet}"/>
....
</route>
我在方法的第一行放置了一个调试器,样式表
值总是显示为exchange主体,而不是我试图传递的值(${header.organizationStyleSheet})
如果我通过调试器查看标题,我会看到我的organizationStyleSheet标题和我期望的值,所以我猜我的bean参数绑定有问题吗?以前有其他人碰到过这个吗
另外,我试着用${exchange}
替换*
,但出现了一些错误
org.apache.camel.ExpressionEvaluationException:
Cannot create/evaluate simple expression:
${exchange} to be bound to parameter at index: 0 on method"
这似乎是由于“transformBodyUsingStyleSheet”方法中缺少右括号造成的。我解决了这个问题。这件事发生在我身上,我花了几个小时试图调试这个问题。也许我们应该问问克劳斯·易卜生先生,在这种情况下,绑定bean的表达式的解析器是否会失败?@BalabanMario记录了camel项目的一个bug。不用问。
org.apache.camel.ExpressionEvaluationException:
Cannot create/evaluate simple expression:
${exchange} to be bound to parameter at index: 0 on method"