Can you should the method signature for those methods. Also if they are void or return a value. And what version of Camel do you use?
On Fri, Oct 2, 2015 at 10:18 PM, wheli <michael.wheli...@medfx.com> wrote: > I am running into a strange issue with Apache Camel and Spring DSL. Here is > an excerpt of my Spring defined route: > > <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> > > Everything works fine up until the last line that I posted. The > extractDocumentRootOid(Exchange exchange) java method is executed and the > result is stored to the "documentRootOid" header. The > getOrganizationByOid(Exchange exchange, String oid) java method is executed > and the result is stored to the "organization" header. The > extractStyleSheetAttributeFromOrganization(Exchange exchange, Organization > organization) java method is executed and the result is stored to the > "organizationStyleSheet" header. > > Once it gets to the "transformBodyUsingStyleSheet" method, things get weird. > Here is my method declaration: > > public void transformBodyUsingStyleSheet(Exchange exchange, String > styleSheet) > > I put a debugger on the first line of the method and the "styleSheet" value > always appears to be the exchange body, NOT the value that I am trying to > pass in (${header.organizationStyleSheet}). If I look at the headers through > a debugger, I see my "organizationStyleSheet" header and the value that I > expect, so I am guessing that there is an issue with my bean parameter > bindings? Has anyone else ran into this before? > > Thanks for any help you can provide. > > P.S. I tried replacing "*" with "${exchange}" but got a number of errors > saying "org.apache.camel.ExpressionEvaluationException: Cannot > create/evaluate simple expression: ${exchange} to be bound to parameter at > index: 0 on method" > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Apache-Camel-bean-parameter-binding-issue-with-Spring-DSL-tp5772200.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2nd edition: https://www.manning.com/books/camel-in-action-second-edition