Uploaded image for project: 'Commons Compress'
  1. Commons Compress
  2. COMPRESS-582

Pack200CompressorOutputStream fails at runtime in 1.21 if ASM 4.0+ is used

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.21
    • 1.22
    • None
    • None

    Description

      I just tried to upgrade an existing codebase to commons-compress 1.21 (from 1.20, which was working correctly) and encountered the following error in code trying to use the Pack200CompressorOutputStream:

      java.lang.IncompatibleClassChangeError: class 
      org.apache.commons.compress.harmony.pack200.Segment can not implement 
      org.objectweb.asm.ClassVisitor, because it is not an interface 
      (org.objectweb.asm.ClassVisitor is in unnamed module of loader 'app')
      

      The Segment class implements rather than extends ClassVisitor. It looks like commons-compress is built against asm 3.2. Per https://asm.ow2.io/versions.html, ClassVisitor was converted from an interface to an abstract class in asm 4.0, which was released in 2011, "in order to ensure backward binary compatibility in future ASM versions". To be clear, our project needs a more recent asm version on the classpath to support other libraries.

      I have a repro of the error here, in case it helps: https://github.com/AlexLandau/commons-compress-asm-error

      I want to add that I appreciate the effort you are making to support pack200 in a way that will outlast the JDK's native support.

      Attachments

        Activity

          People

            Unassigned Unassigned
            AlexLandau Alex Landau
            Votes:
            0 Vote for this issue
            Watchers:
            3 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