Re: [ANNOUNCEMENT] Apache Camel 3.0.0 Released

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [ANNOUNCEMENT] Apache Camel 3.0.0 Released

Ron Cecchini
Christmas has come early!

There's so much new stuff I'm not even sure what I should be excited about at the moment - but I'm excited!

Thank you for all your efforts, guys!

(and now I can spend pre-Thanksgiving feasting working through the Migration and eliminating the run-time crashes...)

> On November 28, 2019 at 9:12 AM Gregor Zurowski <[hidden email]> wrote:
>
>
> It's finally here - after four release candidates and three milestone
> releases, the Camel community announces the immediate availability of
> Camel 3.0.0, a new major release with over 1000 new features,
> improvements and fixes.
>
> Please read our migration guide [1] that describes how to upgrade
> Camel 2.x applications to Camel 3.0.
>
> The artifacts are published and ready for you to download [2] either
> from the Apache mirrors or from the Central Maven repository. For more
> details please take a look at the release notes [3, 4].
>
> Many thanks to all who made this release possible.
>
> On behalf of the Camel PMC,
> Gregor Zurowski
>
> [1] https://camel.apache.org/manual/latest/camel-3-migration-guide.html
> [1] http://camel.apache.org/download.html
> [2] https://camel.apache.org/blog/release-3-0-0.html
> [3] https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12315691&projectId=12311211
Reply | Threaded
Open this post in threaded view
|

Re: [ANNOUNCEMENT] Apache Camel 3.0.0 Released

Claus Ibsen-2
Yay awesome to see its finally out and we made it possible within 1 year of
work

I will work on a blog post with summary of the noteworthy new features and
changes



On Thu, 28 Nov 2019 at 15.13, Gregor Zurowski <[hidden email]>
wrote:

> It's finally here - after four release candidates and three milestone
> releases, the Camel community announces the immediate availability of
> Camel 3.0.0, a new major release with over 1000 new features,
> improvements and fixes.
>
> Please read our migration guide [1] that describes how to upgrade
> Camel 2.x applications to Camel 3.0.
>
> The artifacts are published and ready for you to download [2] either
> from the Apache mirrors or from the Central Maven repository. For more
> details please take a look at the release notes [3, 4].
>
> Many thanks to all who made this release possible.
>
> On behalf of the Camel PMC,
> Gregor Zurowski
>
> [1] https://camel.apache.org/manual/latest/camel-3-migration-guide.html
> [1] http://camel.apache.org/download.html
> [2] https://camel.apache.org/blog/release-3-0-0.html
> [3]
> https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12315691&projectId=12311211
>
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Reply | Threaded
Open this post in threaded view
|

Re: [ANNOUNCEMENT] Apache Camel 3.0.0 Released

tadayosi
In reply to this post by Ron Cecchini
Congratulations!  It's an epic release indeed!

Thanks everyone for making it happen!

Best regards,
Tadayoshi

On Thu, Nov 28, 2019 at 11:13 PM Gregor Zurowski <[hidden email]>
wrote:

> It's finally here - after four release candidates and three milestone
> releases, the Camel community announces the immediate availability of
> Camel 3.0.0, a new major release with over 1000 new features,
> improvements and fixes.
>
> Please read our migration guide [1] that describes how to upgrade
> Camel 2.x applications to Camel 3.0.
>
> The artifacts are published and ready for you to download [2] either
> from the Apache mirrors or from the Central Maven repository. For more
> details please take a look at the release notes [3, 4].
>
> Many thanks to all who made this release possible.
>
> On behalf of the Camel PMC,
> Gregor Zurowski
>
> [1] https://camel.apache.org/manual/latest/camel-3-migration-guide.html
> [1] http://camel.apache.org/download.html
> [2] https://camel.apache.org/blog/release-3-0-0.html
> [3]
> https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12315691&projectId=12311211
>


--
Tadayoshi Sato
Reply | Threaded
Open this post in threaded view
|

AW: [ANNOUNCEMENT] Apache Camel 3.0.0 Released

Daniel.Novak
Hi guys,


I'm looking forward into working with the new version.

Congratulations and respect for your hard work!


But I do have some questions:

  *   When will there be a "Camel in Action 3" book from Claus?
  *   Since the migration is quite a task with all the changes, how long is there support for Version 2.x regarding security topics and so on?
  *   We planned to switch to Amazon Corretto. Is this also possible?

Thanks in advance,
best regards
Daniel



________________________________
Von: Grzegorz Grzybek <[hidden email]>
Gesendet: Freitag, 29. November 2019 15:37
An: [hidden email]
Cc: [hidden email]
Betreff: Re: [ANNOUNCEMENT] Apache Camel 3.0.0 Released

Congratulations!

Time to celebrate - amazing work!

regards
Grzegorz Grzybek

pt., 29 lis 2019 o 03:56 Tadayoshi Sato <[hidden email]>
napisał(a):

> Congratulations!  It's an epic release indeed!
>
> Thanks everyone for making it happen!
>
> Best regards,
> Tadayoshi
>
> On Thu, Nov 28, 2019 at 11:13 PM Gregor Zurowski <[hidden email]
> >
> wrote:
>
> > It's finally here - after four release candidates and three milestone
> > releases, the Camel community announces the immediate availability of
> > Camel 3.0.0, a new major release with over 1000 new features,
> > improvements and fixes.
> >
> > Please read our migration guide [1] that describes how to upgrade
> > Camel 2.x applications to Camel 3.0.
> >
> > The artifacts are published and ready for you to download [2] either
> > from the Apache mirrors or from the Central Maven repository. For more
> > details please take a look at the release notes [3, 4].
> >
> > Many thanks to all who made this release possible.
> >
> > On behalf of the Camel PMC,
> > Gregor Zurowski
> >
> > [1] https://camel.apache.org/manual/latest/camel-3-migration-guide.html
> > [1] http://camel.apache.org/download.html
> > [2] https://camel.apache.org/blog/release-3-0-0.html
> > [3]
> >
> https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12315691&projectId=12311211
> >
>
>
> --
> Tadayoshi Sato
>

**********************************************************************
This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please call or e-mail the sender and delete the message and any attachment from your system. If you are not the intended recipient, you must not copy this message or attachment or disclose the contents to any other person. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive later or incomplete, or contain viruses. DZ PRIVATBANK therefore does not accept liability for any errors or omissions in the contents of this message which arises as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes only and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments. DZ PRIVATBANK does not warrant that incoming e-mails will be processed within a certain period of time. For security reasons, DZ PRIVATBANK does not accept any instructions that must be in writing (financial transactions, changes of address, etc.) sent by e-mail. If a message is urgent, please contact us by telephone.
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: [ANNOUNCEMENT] Apache Camel 3.0.0 Released

Ron Cecchini
In reply to this post by Ron Cecchini
TL;DR: unmarshalling JSON to POJO with Jackson is no longer working on a java.time.OffsetDateTime since migrating to Camel 3.0.  java.util.Date still works fine though.

Ok, after 2 days of googling and trying all manner of sorcery (except for sacrificing a chicken... maybe I should?), I'm waving the white flag on this one...

Basically, I had worked through all the migration stuff.  I also updated Spring Boot to 2.2.1.RELEASE, and updated all the *-starter dependencies, etc.  Everything was working great.

Eventually I uncommented some code I hadn't been using for a while - and that's when the "fun" began...

The input to the route in question is a JSON array upon which I do a .split().jsonpathWriteAsString("$") and eventually an .unmarshal(pojoJson) where 'pojoJson' is:

    JacksonDataFormat pojoJson = new JacksonDataFormat(MyPojo.class);

Things were working fantastic before the migration, but now I get:

    com.fasterxml.jackson.databind.exc.InvalidDefinitionException:
    Cannot construct instance of `java.time.OffsetDateTime` (no Creators, like default construct, exist):
    no String-argument constructor/factory method to deserialize from String value ('2019-11-14T04:41:33.302711Z')

Googling revealed all kinds of stuff related to Jackson and Java 8 date/times posted over the last few years.

I tried a few of the suggestions, including adding several Jackson-specific dependencies (to go along with 'org.apache.camel.springboot:camel-jackson-starter') - and adding the dependencies in different orders (someone said that could be a factor) - and nothing worked.

Based on a few suggestions, I even created the following @PostConstruct method in my @SpringBootApplication class, and again got the same "no Creators" error:

    @PostConstruct
    public void setUp ()
    {
        context.getGlobalOptions().put("CamelJacksonEnableTypeConverter", "true");
        context.getGlobalOptions().put("CamelJacksonTypeConverterToPojo", "true");

        objectMapper.registerModule(new JavaTimeModule());
        objectMapper.registerModule(new JSR310Module());
        objectMapper.registerModule(new Jdk8Module());
        objectMapper.findAndRegisterModules();
    }

I even tried switching jsonpathWriteAsString("$") to jsonpath("$"), setting pojoJson.useMap(), and passing the Map from jsonpath() to unmarshal, and this time got:

    Caused by: org.apache.camel.NoTypeConversionAvailableException:
    No type converter available to convert from type: java.util.LinkedHashMap to the required type:
    java.io.InputStream with value [...]

I finally hit on a temporary workaround - going back to using a java.util.Date instead of a java.time.OffsetDateTime - and it again all works great with Camel 3.0.  But eventually I'll probably need to figure out how to use the newer Java date/times.

Thanks for reading this far and helping me figure out where I went wrong...

> On November 28, 2019 at 2:09 PM Ron Cecchini <[hidden email]> wrote:
>
>
> Christmas has come early!
>
> There's so much new stuff I'm not even sure what I should be excited about at the moment - but I'm excited!
>
> Thank you for all your efforts, guys!
>
> (and now I can spend pre-Thanksgiving feasting working through the Migration and eliminating the run-time crashes...)
>
> > On November 28, 2019 at 9:12 AM Gregor Zurowski <[hidden email]> wrote:
> >
> >
> > It's finally here - after four release candidates and three milestone
> > releases, the Camel community announces the immediate availability of
> > Camel 3.0.0, a new major release with over 1000 new features,
> > improvements and fixes.
> >
> > Please read our migration guide [1] that describes how to upgrade
> > Camel 2.x applications to Camel 3.0.
> >
> > The artifacts are published and ready for you to download [2] either
> > from the Apache mirrors or from the Central Maven repository. For more
> > details please take a look at the release notes [3, 4].
> >
> > Many thanks to all who made this release possible.
> >
> > On behalf of the Camel PMC,
> > Gregor Zurowski
> >
> > [1] https://camel.apache.org/manual/latest/camel-3-migration-guide.html
> > [1] http://camel.apache.org/download.html
> > [2] https://camel.apache.org/blog/release-3-0-0.html
> > [3] https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12315691&projectId=12311211
Reply | Threaded
Open this post in threaded view
|

Re: [ANNOUNCEMENT] Apache Camel 3.0.0 Released

Andrea Cosentino-3
Why asking this on the announcement thread? Can't you start a different
thread?

Il lun 2 dic 2019, 06:21 Ron Cecchini <[hidden email]> ha scritto:

> TL;DR: unmarshalling JSON to POJO with Jackson is no longer working on a
> java.time.OffsetDateTime since migrating to Camel 3.0.  java.util.Date
> still works fine though.
>
> Ok, after 2 days of googling and trying all manner of sorcery (except for
> sacrificing a chicken... maybe I should?), I'm waving the white flag on
> this one...
>
> Basically, I had worked through all the migration stuff.  I also updated
> Spring Boot to 2.2.1.RELEASE, and updated all the *-starter dependencies,
> etc.  Everything was working great.
>
> Eventually I uncommented some code I hadn't been using for a while - and
> that's when the "fun" began...
>
> The input to the route in question is a JSON array upon which I do a
> .split().jsonpathWriteAsString("$") and eventually an .unmarshal(pojoJson)
> where 'pojoJson' is:
>
>     JacksonDataFormat pojoJson = new JacksonDataFormat(MyPojo.class);
>
> Things were working fantastic before the migration, but now I get:
>
>     com.fasterxml.jackson.databind.exc.InvalidDefinitionException:
>     Cannot construct instance of `java.time.OffsetDateTime` (no Creators,
> like default construct, exist):
>     no String-argument constructor/factory method to deserialize from
> String value ('2019-11-14T04:41:33.302711Z')
>
> Googling revealed all kinds of stuff related to Jackson and Java 8
> date/times posted over the last few years.
>
> I tried a few of the suggestions, including adding several
> Jackson-specific dependencies (to go along with
> 'org.apache.camel.springboot:camel-jackson-starter') - and adding the
> dependencies in different orders (someone said that could be a factor) -
> and nothing worked.
>
> Based on a few suggestions, I even created the following @PostConstruct
> method in my @SpringBootApplication class, and again got the same "no
> Creators" error:
>
>     @PostConstruct
>     public void setUp ()
>     {
>         context.getGlobalOptions().put("CamelJacksonEnableTypeConverter",
> "true");
>         context.getGlobalOptions().put("CamelJacksonTypeConverterToPojo",
> "true");
>
>         objectMapper.registerModule(new JavaTimeModule());
>         objectMapper.registerModule(new JSR310Module());
>         objectMapper.registerModule(new Jdk8Module());
>         objectMapper.findAndRegisterModules();
>     }
>
> I even tried switching jsonpathWriteAsString("$") to jsonpath("$"),
> setting pojoJson.useMap(), and passing the Map from jsonpath() to
> unmarshal, and this time got:
>
>     Caused by: org.apache.camel.NoTypeConversionAvailableException:
>     No type converter available to convert from type:
> java.util.LinkedHashMap to the required type:
>     java.io.InputStream with value [...]
>
> I finally hit on a temporary workaround - going back to using a
> java.util.Date instead of a java.time.OffsetDateTime - and it again all
> works great with Camel 3.0.  But eventually I'll probably need to figure
> out how to use the newer Java date/times.
>
> Thanks for reading this far and helping me figure out where I went wrong...
>
> > On November 28, 2019 at 2:09 PM Ron Cecchini <[hidden email]>
> wrote:
> >
> >
> > Christmas has come early!
> >
> > There's so much new stuff I'm not even sure what I should be excited
> about at the moment - but I'm excited!
> >
> > Thank you for all your efforts, guys!
> >
> > (and now I can spend pre-Thanksgiving feasting working through the
> Migration and eliminating the run-time crashes...)
> >
> > > On November 28, 2019 at 9:12 AM Gregor Zurowski <
> [hidden email]> wrote:
> > >
> > >
> > > It's finally here - after four release candidates and three milestone
> > > releases, the Camel community announces the immediate availability of
> > > Camel 3.0.0, a new major release with over 1000 new features,
> > > improvements and fixes.
> > >
> > > Please read our migration guide [1] that describes how to upgrade
> > > Camel 2.x applications to Camel 3.0.
> > >
> > > The artifacts are published and ready for you to download [2] either
> > > from the Apache mirrors or from the Central Maven repository. For more
> > > details please take a look at the release notes [3, 4].
> > >
> > > Many thanks to all who made this release possible.
> > >
> > > On behalf of the Camel PMC,
> > > Gregor Zurowski
> > >
> > > [1]
> https://camel.apache.org/manual/latest/camel-3-migration-guide.html
> > > [1] http://camel.apache.org/download.html
> > > [2] https://camel.apache.org/blog/release-3-0-0.html
> > > [3]
> https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12315691&projectId=12311211
>
Reply | Threaded
Open this post in threaded view
|

AW: [ANNOUNCEMENT] Apache Camel 3.0.0 Released

Thomas Thiele
In reply to this post by tadayosi
Hi,

But camel-spring-boot-starter is still 3.0.0-RC3 ?

-----Ursprüngliche Nachricht-----
Von: Grzegorz Grzybek <[hidden email]>
Gesendet: Freitag, 29. November 2019 15:37
An: [hidden email]
Cc: [hidden email]
Betreff: Re: [ANNOUNCEMENT] Apache Camel 3.0.0 Released

Congratulations!

Time to celebrate - amazing work!

regards
Grzegorz Grzybek

pt., 29 lis 2019 o 03:56 Tadayoshi Sato <[hidden email]>
napisał(a):

> Congratulations!  It's an epic release indeed!
>
> Thanks everyone for making it happen!
>
> Best regards,
> Tadayoshi
>
> On Thu, Nov 28, 2019 at 11:13 PM Gregor Zurowski
> <[hidden email]
> >
> wrote:
>
> > It's finally here - after four release candidates and three
> > milestone releases, the Camel community announces the immediate
> > availability of Camel 3.0.0, a new major release with over 1000 new
> > features, improvements and fixes.
> >
> > Please read our migration guide [1] that describes how to upgrade
> > Camel 2.x applications to Camel 3.0.
> >
> > The artifacts are published and ready for you to download [2] either
> > from the Apache mirrors or from the Central Maven repository. For
> > more details please take a look at the release notes [3, 4].
> >
> > Many thanks to all who made this release possible.
> >
> > On behalf of the Camel PMC,
> > Gregor Zurowski
> >
> > [1]
> > https://camel.apache.org/manual/latest/camel-3-migration-guide.html
> > [1] http://camel.apache.org/download.html
> > [2] https://camel.apache.org/blog/release-3-0-0.html
> > [3]
> >
> https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=1231569
> 1&projectId=12311211
> >
>
>
> --
> Tadayoshi Sato
>
Reply | Threaded
Open this post in threaded view
|

Re: [ANNOUNCEMENT] Apache Camel 3.0.0 Released

Andrea Cosentino-3
It's in the migration guide by the way

https://camel.apache.org/manual/latest/camel-3-migration-guide.html#_spring_boot_starters_maven_coordinate_change

Il giorno lun 2 dic 2019 alle ore 15:24 Andrea Cosentino <[hidden email]>
ha scritto:

> The groupId of the starters has been changed
> from org.apache.camel to org.apache.camel.springboot
>
> https://search.maven.org/search?q=g:org.apache.camel.springboot
>
> Il giorno lun 2 dic 2019 alle ore 15:23 <[hidden email]> ha
> scritto:
>
>> Hi,
>>
>> But camel-spring-boot-starter is still 3.0.0-RC3 ?
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Grzegorz Grzybek <[hidden email]>
>> Gesendet: Freitag, 29. November 2019 15:37
>> An: [hidden email]
>> Cc: [hidden email]
>> Betreff: Re: [ANNOUNCEMENT] Apache Camel 3.0.0 Released
>>
>> Congratulations!
>>
>> Time to celebrate - amazing work!
>>
>> regards
>> Grzegorz Grzybek
>>
>> pt., 29 lis 2019 o 03:56 Tadayoshi Sato <[hidden email]>
>> napisał(a):
>>
>> > Congratulations!  It's an epic release indeed!
>> >
>> > Thanks everyone for making it happen!
>> >
>> > Best regards,
>> > Tadayoshi
>> >
>> > On Thu, Nov 28, 2019 at 11:13 PM Gregor Zurowski
>> > <[hidden email]
>> > >
>> > wrote:
>> >
>> > > It's finally here - after four release candidates and three
>> > > milestone releases, the Camel community announces the immediate
>> > > availability of Camel 3.0.0, a new major release with over 1000 new
>> > > features, improvements and fixes.
>> > >
>> > > Please read our migration guide [1] that describes how to upgrade
>> > > Camel 2.x applications to Camel 3.0.
>> > >
>> > > The artifacts are published and ready for you to download [2] either
>> > > from the Apache mirrors or from the Central Maven repository. For
>> > > more details please take a look at the release notes [3, 4].
>> > >
>> > > Many thanks to all who made this release possible.
>> > >
>> > > On behalf of the Camel PMC,
>> > > Gregor Zurowski
>> > >
>> > > [1]
>> > > https://camel.apache.org/manual/latest/camel-3-migration-guide.html
>> > > [1] http://camel.apache.org/download.html
>> > > [2] https://camel.apache.org/blog/release-3-0-0.html
>> > > [3]
>> > >
>> > https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=1231569
>> > 1&projectId=12311211
>> > >
>> >
>> >
>> > --
>> > Tadayoshi Sato
>> >
>>
>
Reply | Threaded
Open this post in threaded view
|

AW: [ANNOUNCEMENT] Apache Camel 3.0.0 Released

Thomas Thiele
In reply to this post by Thomas Thiele
Ahhhh. Thanks. Didn't expect this from 3.0.0-RC3 to 3.0.0

-----Ursprüngliche Nachricht-----
Von: Andrea Cosentino <[hidden email]>
Gesendet: Montag, 2. Dezember 2019 15:25
An: [hidden email]
Cc: dev <[hidden email]>
Betreff: Re: [ANNOUNCEMENT] Apache Camel 3.0.0 Released

The groupId of the starters has been changed from org.apache.camel to org.apache.camel.springboot

https://search.maven.org/search?q=g:org.apache.camel.springboot

Il giorno lun 2 dic 2019 alle ore 15:23 <[hidden email]> ha
scritto:

> Hi,
>
> But camel-spring-boot-starter is still 3.0.0-RC3 ?
>
> -----Ursprüngliche Nachricht-----
> Von: Grzegorz Grzybek <[hidden email]>
> Gesendet: Freitag, 29. November 2019 15:37
> An: [hidden email]
> Cc: [hidden email]
> Betreff: Re: [ANNOUNCEMENT] Apache Camel 3.0.0 Released
>
> Congratulations!
>
> Time to celebrate - amazing work!
>
> regards
> Grzegorz Grzybek
>
> pt., 29 lis 2019 o 03:56 Tadayoshi Sato <[hidden email]>
> napisał(a):
>
> > Congratulations!  It's an epic release indeed!
> >
> > Thanks everyone for making it happen!
> >
> > Best regards,
> > Tadayoshi
> >
> > On Thu, Nov 28, 2019 at 11:13 PM Gregor Zurowski
> > <[hidden email]
> > >
> > wrote:
> >
> > > It's finally here - after four release candidates and three
> > > milestone releases, the Camel community announces the immediate
> > > availability of Camel 3.0.0, a new major release with over 1000
> > > new features, improvements and fixes.
> > >
> > > Please read our migration guide [1] that describes how to upgrade
> > > Camel 2.x applications to Camel 3.0.
> > >
> > > The artifacts are published and ready for you to download [2]
> > > either from the Apache mirrors or from the Central Maven
> > > repository. For more details please take a look at the release notes [3, 4].
> > >
> > > Many thanks to all who made this release possible.
> > >
> > > On behalf of the Camel PMC,
> > > Gregor Zurowski
> > >
> > > [1]
> > > https://camel.apache.org/manual/latest/camel-3-migration-guide.htm
> > > l [1] http://camel.apache.org/download.html
> > > [2] https://camel.apache.org/blog/release-3-0-0.html
> > > [3]
> > >
> > https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12315
> > 69
> > 1&projectId=12311211
> > >
> >
> >
> > --
> > Tadayoshi Sato
> >
>
Reply | Threaded
Open this post in threaded view
|

Configuring Jackson for java.time

Zoran Regvart-2
In reply to this post by Ron Cecchini
Hi Ron,
for Jackson you need to add support for Java 8+ features explicitly.

Have a look at how to do it here:

https://github.com/FasterXML/jackson-modules-java8

Jackson JSON data format has a `objectMapper`[2] property that you can
use to set the customized ObjectMapper.

zoran

[2] https://camel.apache.org/components/latest/json-jackson-dataformat.html

On Mon, Dec 2, 2019 at 6:21 AM Ron Cecchini <[hidden email]> wrote:

>
> TL;DR: unmarshalling JSON to POJO with Jackson is no longer working on a java.time.OffsetDateTime since migrating to Camel 3.0.  java.util.Date still works fine though.
>
> Ok, after 2 days of googling and trying all manner of sorcery (except for sacrificing a chicken... maybe I should?), I'm waving the white flag on this one...
>
> Basically, I had worked through all the migration stuff.  I also updated Spring Boot to 2.2.1.RELEASE, and updated all the *-starter dependencies, etc.  Everything was working great.
>
> Eventually I uncommented some code I hadn't been using for a while - and that's when the "fun" began...
>
> The input to the route in question is a JSON array upon which I do a .split().jsonpathWriteAsString("$") and eventually an .unmarshal(pojoJson) where 'pojoJson' is:
>
>     JacksonDataFormat pojoJson = new JacksonDataFormat(MyPojo.class);
>
> Things were working fantastic before the migration, but now I get:
>
>     com.fasterxml.jackson.databind.exc.InvalidDefinitionException:
>     Cannot construct instance of `java.time.OffsetDateTime` (no Creators, like default construct, exist):
>     no String-argument constructor/factory method to deserialize from String value ('2019-11-14T04:41:33.302711Z')
>
> Googling revealed all kinds of stuff related to Jackson and Java 8 date/times posted over the last few years.
>
> I tried a few of the suggestions, including adding several Jackson-specific dependencies (to go along with 'org.apache.camel.springboot:camel-jackson-starter') - and adding the dependencies in different orders (someone said that could be a factor) - and nothing worked.
>
> Based on a few suggestions, I even created the following @PostConstruct method in my @SpringBootApplication class, and again got the same "no Creators" error:
>
>     @PostConstruct
>     public void setUp ()
>     {
>         context.getGlobalOptions().put("CamelJacksonEnableTypeConverter", "true");
>         context.getGlobalOptions().put("CamelJacksonTypeConverterToPojo", "true");
>
>         objectMapper.registerModule(new JavaTimeModule());
>         objectMapper.registerModule(new JSR310Module());
>         objectMapper.registerModule(new Jdk8Module());
>         objectMapper.findAndRegisterModules();
>     }
>
> I even tried switching jsonpathWriteAsString("$") to jsonpath("$"), setting pojoJson.useMap(), and passing the Map from jsonpath() to unmarshal, and this time got:
>
>     Caused by: org.apache.camel.NoTypeConversionAvailableException:
>     No type converter available to convert from type: java.util.LinkedHashMap to the required type:
>     java.io.InputStream with value [...]
>
> I finally hit on a temporary workaround - going back to using a java.util.Date instead of a java.time.OffsetDateTime - and it again all works great with Camel 3.0.  But eventually I'll probably need to figure out how to use the newer Java date/times.
>
> Thanks for reading this far and helping me figure out where I went wrong...
>
> > On November 28, 2019 at 2:09 PM Ron Cecchini <[hidden email]> wrote:
> >
> >
> > Christmas has come early!
> >
> > There's so much new stuff I'm not even sure what I should be excited about at the moment - but I'm excited!
> >
> > Thank you for all your efforts, guys!
> >
> > (and now I can spend pre-Thanksgiving feasting working through the Migration and eliminating the run-time crashes...)
> >
> > > On November 28, 2019 at 9:12 AM Gregor Zurowski <[hidden email]> wrote:
> > >
> > >
> > > It's finally here - after four release candidates and three milestone
> > > releases, the Camel community announces the immediate availability of
> > > Camel 3.0.0, a new major release with over 1000 new features,
> > > improvements and fixes.
> > >
> > > Please read our migration guide [1] that describes how to upgrade
> > > Camel 2.x applications to Camel 3.0.
> > >
> > > The artifacts are published and ready for you to download [2] either
> > > from the Apache mirrors or from the Central Maven repository. For more
> > > details please take a look at the release notes [3, 4].
> > >
> > > Many thanks to all who made this release possible.
> > >
> > > On behalf of the Camel PMC,
> > > Gregor Zurowski
> > >
> > > [1] https://camel.apache.org/manual/latest/camel-3-migration-guide.html
> > > [1] http://camel.apache.org/download.html
> > > [2] https://camel.apache.org/blog/release-3-0-0.html
> > > [3] https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12315691&projectId=12311211



--
Zoran Regvart
Reply | Threaded
Open this post in threaded view
|

Re: Configuring Jackson for java.time

Ron Cecchini
Just an update that I did eventually get it.  Sweet blessed relief...

Thanks to Zoran for a pointer which led to the missing crucial piece.

---

As it turns out, it's not enough to simply add the desired time modules to Jackson's ObjectMapper.  You also *have* to add the ObjectMapper to any JacksonDataFormat you create as it has none on it by default.

For anyone interested, this is all you have to do to get Jackson to deserialize the new java.time.* types:

1. Add the Jackson BOM to <dependencyManagement>

<dependency>
  <groupId>com.fasterxml.jackson</groupId>
  <artifactId>jackson-bom</artifactId>
  <version>2.10.0</version>
  <type>pom</type>
  <scope>import</scope>
</dependency>

2. get the Jackon ObjectMapper and set it on a JacksonDataFormat:

@Autowired
private ObjectMapper objectMapper;

JacksonDataFormat myPojoJson = new JacksonDataFormat(MyPojo.class);
myPojoJson.setObjectMapper(objectMapper);

or, even easier, skip the Autowired and

3. have Jackson auto-discover the ObjectMapper:

myPojoJson.setAutoDiscovery(true);

Note: you don't have to register any modules on the ObjectMapper as the needed ones are already registered.

Also, FWIW, setting the following didn't seem to be necessary:

context.getGlobalOptions().put("CamelJacksonEnableTypeConverter", "true");
context.getGlobalOptions().put("CamelJacksonTypeConverterToPojo", "true");

> On December 2, 2019 at 10:10 AM Zoran Regvart <[hidden email]> wrote:
>
>
> Hi Ron,
> for Jackson you need to add support for Java 8+ features explicitly.
>
> Have a look at how to do it here:
>
> https://github.com/FasterXML/jackson-modules-java8
>
> Jackson JSON data format has a `objectMapper`[2] property that you can
> use to set the customized ObjectMapper.
>
> zoran
>
> [2] https://camel.apache.org/components/latest/json-jackson-dataformat.html
>
> On Mon, Dec 2, 2019 at 6:21 AM Ron Cecchini <[hidden email]> wrote:
> >
> > TL;DR: unmarshalling JSON to POJO with Jackson is no longer working on a java.time.OffsetDateTime since migrating to Camel 3.0.  java.util.Date still works fine though.
> >
> > Ok, after 2 days of googling and trying all manner of sorcery (except for sacrificing a chicken... maybe I should?), I'm waving the white flag on this one...
> >
> > Basically, I had worked through all the migration stuff.  I also updated Spring Boot to 2.2.1.RELEASE, and updated all the *-starter dependencies, etc.  Everything was working great.
> >
> > Eventually I uncommented some code I hadn't been using for a while - and that's when the "fun" began...
> >
> > The input to the route in question is a JSON array upon which I do a .split().jsonpathWriteAsString("$") and eventually an .unmarshal(pojoJson) where 'pojoJson' is:
> >
> >     JacksonDataFormat pojoJson = new JacksonDataFormat(MyPojo.class);
> >
> > Things were working fantastic before the migration, but now I get:
> >
> >     com.fasterxml.jackson.databind.exc.InvalidDefinitionException:
> >     Cannot construct instance of `java.time.OffsetDateTime` (no Creators, like default construct, exist):
> >     no String-argument constructor/factory method to deserialize from String value ('2019-11-14T04:41:33.302711Z')
> >
> > Googling revealed all kinds of stuff related to Jackson and Java 8 date/times posted over the last few years.
> >
> > I tried a few of the suggestions, including adding several Jackson-specific dependencies (to go along with 'org.apache.camel.springboot:camel-jackson-starter') - and adding the dependencies in different orders (someone said that could be a factor) - and nothing worked.
> >
> > Based on a few suggestions, I even created the following @PostConstruct method in my @SpringBootApplication class, and again got the same "no Creators" error:
> >
> >     @PostConstruct
> >     public void setUp ()
> >     {
> >         context.getGlobalOptions().put("CamelJacksonEnableTypeConverter", "true");
> >         context.getGlobalOptions().put("CamelJacksonTypeConverterToPojo", "true");
> >
> >         objectMapper.registerModule(new JavaTimeModule());
> >         objectMapper.registerModule(new JSR310Module());
> >         objectMapper.registerModule(new Jdk8Module());
> >         objectMapper.findAndRegisterModules();
> >     }
> >
> > I even tried switching jsonpathWriteAsString("$") to jsonpath("$"), setting pojoJson.useMap(), and passing the Map from jsonpath() to unmarshal, and this time got:
> >
> >     Caused by: org.apache.camel.NoTypeConversionAvailableException:
> >     No type converter available to convert from type: java.util.LinkedHashMap to the required type:
> >     java.io.InputStream with value [...]
> >
> > I finally hit on a temporary workaround - going back to using a java.util.Date instead of a java.time.OffsetDateTime - and it again all works great with Camel 3.0.  But eventually I'll probably need to figure out how to use the newer Java date/times.
> >
> > Thanks for reading this far and helping me figure out where I went wrong...
> >
> > > On November 28, 2019 at 2:09 PM Ron Cecchini <[hidden email]> wrote:
> > >
> > >
> > > Christmas has come early!
> > >
> > > There's so much new stuff I'm not even sure what I should be excited about at the moment - but I'm excited!
> > >
> > > Thank you for all your efforts, guys!
> > >
> > > (and now I can spend pre-Thanksgiving feasting working through the Migration and eliminating the run-time crashes...)
> > >
> > > > On November 28, 2019 at 9:12 AM Gregor Zurowski <[hidden email]> wrote:
> > > >
> > > >
> > > > It's finally here - after four release candidates and three milestone
> > > > releases, the Camel community announces the immediate availability of
> > > > Camel 3.0.0, a new major release with over 1000 new features,
> > > > improvements and fixes.
> > > >
> > > > Please read our migration guide [1] that describes how to upgrade
> > > > Camel 2.x applications to Camel 3.0.
> > > >
> > > > The artifacts are published and ready for you to download [2] either
> > > > from the Apache mirrors or from the Central Maven repository. For more
> > > > details please take a look at the release notes [3, 4].
> > > >
> > > > Many thanks to all who made this release possible.
> > > >
> > > > On behalf of the Camel PMC,
> > > > Gregor Zurowski
> > > >
> > > > [1] https://camel.apache.org/manual/latest/camel-3-migration-guide.html
> > > > [1] http://camel.apache.org/download.html
> > > > [2] https://camel.apache.org/blog/release-3-0-0.html
> > > > [3] https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12315691&projectId=12311211
>
>
>
> --
> Zoran Regvart