【问题标题】:java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer when deploying to Google App Enginejava.lang.NoClassDefFoundError:部署到 Google App Engine 时无法初始化类 net.sf.cglib.proxy.Enhancer
【发布时间】:2013-03-23 00:00:18
【问题描述】:

我正在使用 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 但是当我检查它已经存在时。第二个日志看不懂

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

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

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

提前致谢

【问题讨论】:

标签: java google-app-engine spring-mvc


【解决方案1】:

在 pom.xml 文件中从 appium java-client 中排除 cglib 依赖项,如下所示。经过大量的谷歌搜索后,这为我解决了这个问题。

<dependency>
      <groupId>io.appium</groupId>
      <artifactId>java-client</artifactId>
      <version>7.3.0</version>
      <exclusions>
        <exclusion>
          <groupId>cglib</groupId>
          <artifactId>cglib</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

【讨论】:

    【解决方案2】:

    看起来 Spring 3.2 已经包含 cglib 和 asm(请参阅发行说明的第 4.21 项:http://static.springsource.org/spring-framework/docs/3.2.0.RELEASE/spring-framework-reference/html/new-in-3.2.html)。它们在弹簧芯罐中。

    您应该尝试从类路径中删除 asm 和 cglib jar,看看是否有什么不同。

    【讨论】:

      猜你喜欢
      • 2013-02-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-12
      • 1970-01-01
      • 2014-08-10
      • 1970-01-01
      • 2012-10-10
      相关资源
      最近更新 更多