You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by XiLai Dai <xl...@talend.com> on 2018/01/03 08:04:27 UTC

Problem after upgrade to Camel 2.20.x from 2.19.x

Hi, there,


We have some classes which extends DefaultMessage, they were working well with Camel 2.19 or below version, but after upgrade to Camel 2.20.x, the IllegalArgumentException is always thrown from the default constructor of these classes.


java.lang.IllegalArgumentException: CamelContext must be specified on: Message[]
        at org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:342)
        at org.apache.camel.impl.DefaultMessage.createHeaders(DefaultMessage.java:254)
        at org.apache.camel.impl.DefaultMessage.setHeader(DefaultMessage.java:171)
        at org.talend.esb.eventlogging.common.EventTest.testConstructor(EventTest.java:69)


The reason looks like related to the https://issues.apache.org/jira/browse/CAMEL-11149 , the default DefaultMessage() is marked as Deprecated (really not Deprecated but can't use anymore!), and introduced another constructor DefaultMessage(CamelContext camelContext). so we have to also provide this kind of new constructor for the classes which extends DefaultMessage class, otherwize, "CamelContext must be specified" would be thrown.


I think that's something big changes on API level, and in some cases, the CamelContext is not easy to get and pass to the DefaultMessage. I think its a regression problem, any thought?


Thanks.

Xilai

Re: Problem after upgrade to Camel 2.20.x from 2.19.x

Posted by Onder SEZGIN <on...@apache.org>.
I think you can see major changes from 2.19.x to 2.20.x. This is a major
release.
For minors release where you would not expect such failures would be  going
from 2.19.x goes to 2.19.y


On Wed, Jan 3, 2018 at 11:04 AM, XiLai Dai <xl...@talend.com> wrote:

> Hi, there,
>
>
> We have some classes which extends DefaultMessage, they were working well
> with Camel 2.19 or below version, but after upgrade to Camel 2.20.x, the
> IllegalArgumentException is always thrown from the default constructor of
> these classes.
>
>
> java.lang.IllegalArgumentException: CamelContext must be specified on:
> Message[]
>         at org.apache.camel.util.ObjectHelper.notNull(
> ObjectHelper.java:342)
>         at org.apache.camel.impl.DefaultMessage.createHeaders(
> DefaultMessage.java:254)
>         at org.apache.camel.impl.DefaultMessage.setHeader(
> DefaultMessage.java:171)
>         at org.talend.esb.eventlogging.common.EventTest.
> testConstructor(EventTest.java:69)
>
>
> The reason looks like related to the https://issues.apache.org/
> jira/browse/CAMEL-11149 , the default DefaultMessage() is marked as
> Deprecated (really not Deprecated but can't use anymore!), and introduced
> another constructor DefaultMessage(CamelContext camelContext). so we have
> to also provide this kind of new constructor for the classes which extends
> DefaultMessage class, otherwize, "CamelContext must be specified" would be
> thrown.
>
>
> I think that's something big changes on API level, and in some cases, the
> CamelContext is not easy to get and pass to the DefaultMessage. I think its
> a regression problem, any thought?
>
>
> Thanks.
>
> Xilai
>