CGLIB 與 ASM 版本衝突_cglib

來源:互聯網
上載者:User

CGLIB 版本3.1 內建 ASM 4.2 版本

與引入的 ASM 3.3.1 衝突,


故依賴CGLIB 自身依賴的ASM 即可


 <!-- asm cglib -->        <!--<dependency>-->            <!--<groupId>asm</groupId>-->            <!--<artifactId>asm</artifactId>-->            <!--<version>${asm.version}</version>-->        <!--</dependency>-->        <dependency>            <groupId>cglib</groupId>            <artifactId>cglib</artifactId>            <version>${cglib.version}</version>        </dependency>        <!-- asm cglib -->


cglib3.1- pom

<dependencies>    <dependency>      <groupId>org.ow2.asm</groupId>      <artifactId>asm</artifactId>      <version>4.2</version>    </dependency>    <dependency>      <groupId>org.ow2.asm</groupId>      <artifactId>asm-util</artifactId>      <version>4.2</version>      <optional>true</optional>    </dependency>


網上的解決方案:

cglib版本為3.0或3.1,org.objectweb.asm版本為3.1.0時
版本衝突,報錯java.lang.IncompatibleClassChangeError: class net.sf.cglib.core.DebuggingClassWriter has interface org.objectweb.asm.ClassVisitor as super class
使用cglib 2.2 可解決此問題,該版本中的DebuggingClassWriter的父類為ClassWriter



按照此方案依舊報錯。

lib檔案不匹配,我們下載最新的ASM檔案,則解決了以上問題。

asm-5.2.jar

http://forge.ow2.org/projects/asm/




聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.