You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Jussi Nummelin <ju...@gmail.com> on 2009/10/02 11:27:39 UTC

Camel problems

Hi,

We're hitting a bit peculiar Camel problem.

We have our Camel route defined like this:
<bean id="enricher" class="SomeBean"/>

  <camelContext id="camelContext" useJmx="true"
xmlns="http://activemq.apache.org/camel/schema/spring">

  <route>
	<from uri="jbi:service:Notification"/> <!-- the "sender" endpoint,
e.g. a file poller -->
	<bean ref="enricher" method="processExchange"/>
	<to uri="jbi:service:Test" />		
 </route>


So in practice what we want to do is to "enrich" the message before
giving it to another component.

For some reason the call to our enricher bean fails with this message:
org.apache.camel.component.bean.AmbiguousMethodCallException:
Ambiguous method invocations possible: [public static void
SomeBean.print(javax.xml.transform.Source), public void
SomeBean.setDbServiceName(java.lang.String)] on the exchange:
Exchange[JbiMessage:
org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@dbe4e5]

Does this mean that what ever message we're passing is actually a
String object and thus Camel is trying to select a suitable void
xxx(String arg) type of method? As we have the method defined in the
route, why is Camel overriding it?

Our processing method signature is:
public void processExchange(org.apache.camel.Exchange exchange);

Any help appreciated.


Cheers,
- Jussi -

[ANN]VTD-XML 2.7

Posted by jimmy Zhang <cr...@comcast.net>.
VTD-XML 2.7 (http://vtd-xml.sf.net) is released and can be downloaded at

http://sourceforge.net/projects/vtd-xml/files/.
Below is a summary of what are the new features and enhancements.

Expanded VTD-XML's Core API

  a.. VTDNav: toStringUpperCase, toStringLowerCase, contains(), endsWith(),
  startsWith()
  b.. Extended VTD added in-memory buffer support

Improved Xpath
  a.. Added the following XPath 2.0 functions: abs(), ends-with(), 
upper-case(),  lower-case()
  b.. Added support for variable reference * significantly enhanced XPath
  syntax, checking error reporting (Special thanks to Mark Swanson)
  c.. Internal performance tuning Bug fixes and

Code Enhancement
  a.. C version significantly removed warning message, fix memory leak 
during  Xpath expression parsing,
  b.. Various bug fies (Special thanks to Jon Roberts, John Zhu, Matej 
Spiller,  Steve Polson, and Romain La Tellier)


Re: Camel problems

Posted by Gert Vanthienen <ge...@gmail.com>.
Jussi,

You can download a SNAPSHOT version of the updated servicemix-camel
component using Camel 2.0 at
https://repository.apache.org/content/groups/snapshots-group/org/apache/servicemix/servicemix-camel/2009.02-SNAPSHOT/

Regards,

Gert Vanthienen
------------------------
Open Source SOA: http://fusesource.com
Blog: http://gertvanthienen.blogspot.com/



2009/10/2 Jussi Nummelin <ju...@gmail.com>:
> Hi Claus,
>
> Yep, we're using 1.6 version since it's the one packaged with
> ServiceMix Camel component. :(
>
> I'll modify the code to use hte Processor concept.
>
>
> Thanks a lot for the clarification.
>
> Cheers,
> - Jussi -
>
>
> On Fri, Oct 2, 2009 at 12:34 PM, Claus Ibsen <cl...@gmail.com> wrote:
>> On Fri, Oct 2, 2009 at 11:27 AM, Jussi Nummelin
>> <ju...@gmail.com> wrote:
>>> Hi,
>>>
>>> We're hitting a bit peculiar Camel problem.
>>>
>>> We have our Camel route defined like this:
>>> <bean id="enricher" class="SomeBean"/>
>>>
>>>  <camelContext id="camelContext" useJmx="true"
>>> xmlns="http://activemq.apache.org/camel/schema/spring">
>>>
>>>  <route>
>>>        <from uri="jbi:service:Notification"/> <!-- the "sender" endpoint,
>>> e.g. a file poller -->
>>>        <bean ref="enricher" method="processExchange"/>
>>>        <to uri="jbi:service:Test" />
>>>  </route>
>>>
>>>
>>> So in practice what we want to do is to "enrich" the message before
>>> giving it to another component.
>>>
>>> For some reason the call to our enricher bean fails with this message:
>>> org.apache.camel.component.bean.AmbiguousMethodCallException:
>>> Ambiguous method invocations possible: [public static void
>>> SomeBean.print(javax.xml.transform.Source), public void
>>> SomeBean.setDbServiceName(java.lang.String)] on the exchange:
>>> Exchange[JbiMessage:
>>> org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@dbe4e5]
>>>
>>> Does this mean that what ever message we're passing is actually a
>>> String object and thus Camel is trying to select a suitable void
>>> xxx(String arg) type of method? As we have the method defined in the
>>> route, why is Camel overriding it?
>>>
>>> Our processing method signature is:
>>> public void processExchange(org.apache.camel.Exchange exchange);
>>>
>>> Any help appreciated.
>>>
>>>
>>> Cheers,
>>> - Jussi -
>>>
>>
>> I assume you are using Camel 1.x which have a bug where even the
>> method="xxx" does not always pick this method.
>> Its fixed in 2.0 and maybe the latest 1.x as well (cant remember).
>>
>> You can work around this by having a single method in your bean or use
>> a Processor instead.
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>

Re: Camel problems

Posted by Jussi Nummelin <ju...@gmail.com>.
Hi Claus,

Yep, we're using 1.6 version since it's the one packaged with
ServiceMix Camel component. :(

I'll modify the code to use hte Processor concept.


Thanks a lot for the clarification.

Cheers,
- Jussi -


On Fri, Oct 2, 2009 at 12:34 PM, Claus Ibsen <cl...@gmail.com> wrote:
> On Fri, Oct 2, 2009 at 11:27 AM, Jussi Nummelin
> <ju...@gmail.com> wrote:
>> Hi,
>>
>> We're hitting a bit peculiar Camel problem.
>>
>> We have our Camel route defined like this:
>> <bean id="enricher" class="SomeBean"/>
>>
>>  <camelContext id="camelContext" useJmx="true"
>> xmlns="http://activemq.apache.org/camel/schema/spring">
>>
>>  <route>
>>        <from uri="jbi:service:Notification"/> <!-- the "sender" endpoint,
>> e.g. a file poller -->
>>        <bean ref="enricher" method="processExchange"/>
>>        <to uri="jbi:service:Test" />
>>  </route>
>>
>>
>> So in practice what we want to do is to "enrich" the message before
>> giving it to another component.
>>
>> For some reason the call to our enricher bean fails with this message:
>> org.apache.camel.component.bean.AmbiguousMethodCallException:
>> Ambiguous method invocations possible: [public static void
>> SomeBean.print(javax.xml.transform.Source), public void
>> SomeBean.setDbServiceName(java.lang.String)] on the exchange:
>> Exchange[JbiMessage:
>> org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@dbe4e5]
>>
>> Does this mean that what ever message we're passing is actually a
>> String object and thus Camel is trying to select a suitable void
>> xxx(String arg) type of method? As we have the method defined in the
>> route, why is Camel overriding it?
>>
>> Our processing method signature is:
>> public void processExchange(org.apache.camel.Exchange exchange);
>>
>> Any help appreciated.
>>
>>
>> Cheers,
>> - Jussi -
>>
>
> I assume you are using Camel 1.x which have a bug where even the
> method="xxx" does not always pick this method.
> Its fixed in 2.0 and maybe the latest 1.x as well (cant remember).
>
> You can work around this by having a single method in your bean or use
> a Processor instead.
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>

Re: Camel problems

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Oct 2, 2009 at 11:27 AM, Jussi Nummelin
<ju...@gmail.com> wrote:
> Hi,
>
> We're hitting a bit peculiar Camel problem.
>
> We have our Camel route defined like this:
> <bean id="enricher" class="SomeBean"/>
>
>  <camelContext id="camelContext" useJmx="true"
> xmlns="http://activemq.apache.org/camel/schema/spring">
>
>  <route>
>        <from uri="jbi:service:Notification"/> <!-- the "sender" endpoint,
> e.g. a file poller -->
>        <bean ref="enricher" method="processExchange"/>
>        <to uri="jbi:service:Test" />
>  </route>
>
>
> So in practice what we want to do is to "enrich" the message before
> giving it to another component.
>
> For some reason the call to our enricher bean fails with this message:
> org.apache.camel.component.bean.AmbiguousMethodCallException:
> Ambiguous method invocations possible: [public static void
> SomeBean.print(javax.xml.transform.Source), public void
> SomeBean.setDbServiceName(java.lang.String)] on the exchange:
> Exchange[JbiMessage:
> org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@dbe4e5]
>
> Does this mean that what ever message we're passing is actually a
> String object and thus Camel is trying to select a suitable void
> xxx(String arg) type of method? As we have the method defined in the
> route, why is Camel overriding it?
>
> Our processing method signature is:
> public void processExchange(org.apache.camel.Exchange exchange);
>
> Any help appreciated.
>
>
> Cheers,
> - Jussi -
>

I assume you are using Camel 1.x which have a bug where even the
method="xxx" does not always pick this method.
Its fixed in 2.0 and maybe the latest 1.x as well (cant remember).

You can work around this by having a single method in your bean or use
a Processor instead.


-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus