2

On Camel 2.10.1, the following worked:

<camel:bean ref="profilingBean" method="addProfilingContext('TEST')"/>

The method in question takes a String parameter

Migrating to 2.10.6 , this does not work anymore, it tries to call TEST as another class. I have tried wrapping with ${} , trying to use exotic combinations of "& quot;" etc...

The only solution I found was to put the value in a header using constant language then call the header using simple. Obviously, this isn't very clean...

Do you have any ideas how to do this?

Cheers

YMA
  • 259
  • 3
  • 14

2 Answers2

4

The behavior/bug still exists in Camel 2.16 and also in latest 2.18.2.

For every string constant that is passed to a bean via Spring DSL a java.lang.ClassNotFoundException is thrown. It gets more visible by setting logger for org.apache.camel.util.ObjectHelper to TRACE.

This camel behavior also has serious negative performance impact because ClassLoader method (java.lang.ClassLoader.loadClass) is synchronized for a given parameter name. I wrote a little demo to show this: https://github.com/groundhog2k/camel-dsl-bean-bug

Gabriel's Messanger
  • 3,213
  • 17
  • 31
1

Your solution with the header is fine. The bug you talk about should be fixed in 2.10.7, or 2.11.1 etc.

Claus Ibsen
  • 56,060
  • 7
  • 50
  • 65