java.lang.NoClassDefFoundError:部署到Google App Engine时无法初始化类net.sf.cglib.proxy.Enhancer


问题内容

我正在使用Spring框架和Google App Engine构建Web应用程序。在开发服务器上可以正常工作,但是在部署到Google App
Engine服务器时遇到此错误

Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer

Initialization of bean failed; nested exception is java.lang.IncompatibleClassChangeError: class net.sf.cglib.core.DebuggingClassWriter has interface org.objectweb.asm.ClassVisitor as super class

第一个错误表明我似乎错过了cglib.jar中的net.sf.cglib.proxy.Enhancer,但是当我检查它是否已经存在时。我不明白第二条日志

我在类路径中使用了几个jar文件:

asm-4.0
asm-util-4.0
cglib-3.0
app engine sdk 1.7.6
spring framework 3.2.0

有什么问题?我该如何解决?

提前致谢


问题答案:
看起来Spring
3.2已经包含cglib和asm(请参阅发行说明的项目4.21:[http]( http://static.springsource.org/spring-
framework/docs/3.2.0.RELEASE/spring-framework-reference/html/new-in-3.2.html)
//static.springsource.org/spring-framework/docs/3.2.0.RELEASE/spring-
framework-reference/html/new
-in-3.2.html

)。它们在弹簧芯罐中。

您应该尝试从类路径中删除asm和cglib jar,看看是否有任何区别。