Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-15819

Camel-jsonb: Artifact 'johnzon-jsonb' is required with default settings.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.7.0
    • 3.7.0
    • documentation
    • None
    • Unknown

    Description

      I've created simple reproducer, using spring-boot starter: https://github.com/JiriOndrusek/camel-jsonb-reproducer

       

      There is only 1 route, which marshals pojo and logs it. Reproducer is working.

       

      If you remove dependency to 'johnzon-jsonb' (https://github.com/JiriOndrusek/camel-jsonb-reproducer/blob/main/pom.xml#L101), it start failing with:

       

      Caused by: java.lang.ClassNotFoundException: org.apache.johnzon.jsonb.JohnzonProvider
      at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) ~[na:na]
      at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na]
      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[na:na]
      at javax.json.bind.spi.JsonbProvider.doLoadProvider(JsonbProvider.java:79) ~[geronimo-jsonb_1.0_spec-1.0.jar:1.0]
      ... 54 common frames omitted>

       

      Problem is caused by the fact, that spi uses jonzon as default provider (see https://github.com/apache/geronimo-specs/blob/trunk/geronimo-jsonb_1.0_spec/src/main/java/javax/json/bind/spi/JsonbProvider.java#L30)

       

      Solution could be for example adding jonzon into camel-jsonb or adding to documentation, that provider implementation has to be provided.

      Attachments

        Issue Links

          Activity

            People

              jondruse Jiri Ondrusek
              jondruse Jiri Ondrusek
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: