Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-8155

Update to Jackson 2.10.1

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.3.5, 3.4.0
    • None
    • None
    • Unknown

    Description

      The 2.10.x fails to be processed by pax-exam 4.13.1 (OSGi dependencies, more precisely by biz.aQute.bnd/bndlib/2.4.0 on JDK8 at least), sadly there are no new pax releases to try out.

       

      java.lang.ArrayIndexOutOfBoundsException: 19
      	at aQute.bnd.osgi.Clazz.parseClassFile(Clazz.java:576)
      	at aQute.bnd.osgi.Clazz.parseClassFile(Clazz.java:494)
      	at aQute.bnd.osgi.Clazz.parseClassFileWithCollector(Clazz.java:483)
      	at aQute.bnd.osgi.Clazz.parseClassFile(Clazz.java:473)
      	at aQute.bnd.osgi.Analyzer.analyzeJar(Analyzer.java:2177)
      	at aQute.bnd.osgi.Analyzer.analyzeBundleClasspath(Analyzer.java:2083)
      	at aQute.bnd.osgi.Analyzer.analyze(Analyzer.java:138)
      	at aQute.bnd.osgi.Analyzer.calcManifest(Analyzer.java:616)
      	at org.ops4j.pax.swissbox.bnd.BndUtils.createBundle(BndUtils.java:161)
      	at org.ops4j.pax.url.wrap.internal.Connection.getInputStream(Connection.java:83)
      	at java.net.URL.openStream(URL.java:1067)
      	at org.apache.karaf.features.internal.download.impl.SimpleDownloadTask.download(SimpleDownloadTask.java:78)
      	at org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:60)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      
       

       

      The following changes seems to fix the issues with Jackson 2.10.x update:

       1. Removing wrap for Jackson JAX-RS modules. The 'wrap' caused the issue with bndlib since Jackson 2.10.x introduces module-info.class / built with JDK9+. The exception in the logs:

      java.lang.ArrayIndexOutOfBoundsException: 19
      	at aQute.bnd.osgi.Clazz.parseClassFile(Clazz.java:576)
      	at aQute.bnd.osgi.Clazz.parseClassFile(Clazz.java:494)
      	at aQute.bnd.osgi.Clazz.parseClassFileWithCollector(Clazz.java:483)
      	at aQute.bnd.osgi.Clazz.parseClassFile(Clazz.java:473)
      	at aQute.bnd.osgi.Analyzer.analyzeJar(Analyzer.java:2177)
      	at aQute.bnd.osgi.Analyzer.analyzeBundleClasspath(Analyzer.java:2083)
      	at aQute.bnd.osgi.Analyzer.analyze(Analyzer.java:138)
      	at aQute.bnd.osgi.Analyzer.calcManifest(Analyzer.java:616)
      	at org.ops4j.pax.swissbox.bnd.BndUtils.createBundle(BndUtils.java:161)

      2. The conflicts with 'javax.xml.bind.annotation' exports, forced to remove 'jackson-module-jaxb-annotations' module:

      karaf@root()> find-class javax.xml.bind.annotation.XmlRootElement
      Jackson module: JAXB Annotations (22)
      javax/xml/bind/annotation/XmlRootElement.class
      
      jakarta.xml.bind-api (25)
      javax/xml/bind/annotation/XmlRootElement.class
      

      It basically caused weird issues with our 'AbstractJAXBProvider' / 'JAXBElementProvider' which was not picked up because of 'isXmlType' apparently dealt with two instances of 'XmlRootElement' coming from different bundles.

       

      [1] http://karaf.922171.n3.nabble.com/Karaf-4-2-3-uses-glassfish-jaxb-2-3-2-which-is-java-9-is-this-a-problem-td4055485.html

      [2] https://stackoverflow.com/questions/57808832/apache-karaf-startup-arrayindexoutofboundsexception-19

      Attachments

        Issue Links

          Activity

            People

              reta Andriy Redko
              reta Andriy Redko
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m