【问题标题】:grails run-app throws NoClassDefFoundError for domain classgrails run-app 为域类抛出 NoClassDefFoundError
【发布时间】:2012-11-15 21:14:04
【问题描述】:

我正在尝试运行从另一个开发人员那里继承的 Grails 应用程序。它只有一个域类,我们称之为foopackage.DomainObject。当我编译它时,.class 文件出现在target/classes 中,正如我所期望的那样。但是,当我尝试 grails run-app 时,我得到了

org.springframework.beans.factory.BeanCreationException: Error 
creating bean with name 'pluginManager' defined in ServletContext 
resource [/WEB-INF/applicationContext.xml]: Invocation of init method 
failed; nested exception is java.lang.NoClassDefFoundError: Could not 
initialize class foopackage.DomainObject

起初我认为这可能是因为 DomainObject 试图与损坏的静态初始化程序中不存在的数据库通信,所以我将其缩减为仅

package foopackage

class DomainObject {}

我仍然遇到同样的错误。也许有一些潜在的配置/GORM 问题,但它没有出现在--stacktrace 中。有什么提示吗?

【问题讨论】:

    标签: grails noclassdeffounderror


    【解决方案1】:

    好吧,事实证明它毕竟是静态初始化程序,当我认为我已经排除了我正在编辑错误的文件时。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-03-17
      • 2014-04-16
      • 1970-01-01
      • 2015-08-17
      • 1970-01-01
      • 2010-11-18
      • 2016-01-08
      • 2010-11-08
      相关资源
      最近更新 更多