Hi, You are absolutely right, but it was possible to use <when> in 2.15 without problems.
Claus Ibsen-2 wrote > Hi > > You surely need to add > <filter> > in the route. Having > <when> > standalone > is not intended. So do > > See filter > http://camel.apache.org/message-filter.html > > On Wed, Oct 28, 2015 at 10:06 AM, Clemens < > clemens@ > > wrote: >> Hi, >> >> Sample camel route that will throw "ClassCastException: >> org.apache.camel.model.WhenDefinition cannot be cast to >> org.apache.camel.model.FilterDefinition" at >> DefaultManagementObjectStragety#310. >> >> > <route id="sample"> >> > <from uri="direct:start"> >> >> > <when> >> > <simple> > ${body} != null > </simple> >> > <bean ref="myBean" method="myMethod"> >> > </when> >> > </route> >> >> >> >> >> >> >> >> >> >> >> >> Claus Ibsen-2 wrote >>> Can anyone show some route code with this problem. >>> >>> On Sat, Oct 24, 2015 at 11:55 AM, Clemens < >> >>> clemens@ >> >>> > wrote: >>>> Hi, >>>> >>>> I had the same ClassCaseException When To Filter after upgrading to >>>> 2.16.0. >>>> Seems like in 2.16 >>> > <when> >>> is only allowed inside >>> > <choice> >>> . Outside >>> > <choice> >>>> you must use >>> > <filter> >>> . Prior to 2.16 it was ok to use when outside >>> > <choice> >>>> ....... >>>> >>>> View this message in context: >>>> http://camel.465427.n5.nabble.com/Upgrade-to-2-16-0-tp5772570p5773020.html >>>> Sent from the Camel - Users mailing list archive at Nabble.com >> >> >> >> >> >> -- >> View this message in context: >> http://camel.465427.n5.nabble.com/Upgrade-to-2-16-0-tp5772570p5773136.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 -- View this message in context: http://camel.465427.n5.nabble.com/Upgrade-to-2-16-0-tp5772570p5773141.html Sent from the Camel - Users mailing list archive at Nabble.com.