1.问题描述
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pullService': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: net.sf.cglib.core.Signature.<init>(Ljava/lang/String;Lnet/sf/cglib/asm/Type;[Lnet/sf/cglib/asm/Type;)V2.解决方法
使用的cglib和asm版本如下:
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
<version>2.1_3</version>
</dependency>
<dependency>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
<version>1.5.3</version>
</dependency>
<dependency>
<groupId>asm</groupId>
<artifactId>asm-attrs</artifactId>
<version>1.5.3</version>
</dependency> 同时需要使用如下依赖,干掉其他版本的cglib
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>99.0-does-not-exist</version>
</dependency>
本文详细阐述了在使用Spring框架时遇到BeanCreationException的问题,特别是与CGlib和asm库版本不匹配导致的NoSuchMethodError。通过分析错误信息,作者指导读者如何正确配置依赖项以避免此类问题,并提供了实际的解决步骤。
214

被折叠的 条评论
为什么被折叠?



