java.lang.NoClassDefFoundError: Could not initiali

2019-04-13 00:25发布

I 'm building web application using Spring framework and Google App Engine. In dev server it works but when deploying to Google App Engine server I hit this error

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

and

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

The first error show that I seem to miss net.sf.cglib.proxy.Enhancer in cglib.jar but when I check it's already existed. I can't understand the second log

I use several jars file in classpath:

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

What is problem ? and how can I fix ?

Thanks in advance

1条回答
Rolldiameter
2楼-- · 2019-04-13 00:55

It looks like Spring 3.2 already includes cglib and asm (see item 4.21 of the release notes: http://static.springsource.org/spring-framework/docs/3.2.0.RELEASE/spring-framework-reference/html/new-in-3.2.html). They are in the spring-core jar.

You should try removing the asm and cglib jars from the classpath and see if it makes any difference.

查看更多
登录 后发表回答