1

我正在尝试运行 grails 应用程序,但出现以下异常

严重:向 org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener 类的侦听器实例发送上下文初始化事件的异常

**org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsApplication' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.VerifyError: (class: xls/Recruitment, method: initErrors signature: ()V) Unable to pop operand off an empty stack**

    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)

**Caused by: java.lang.VerifyError: (class: xls/Recruitment, method: initErrors signature: ()V) Unable to pop operand off an empty stack**

    at java.lang.Class.forName(Class.java:247)
    ... 5 more

我正在使用 grails 2.0,例外中提到的招聘类是域类。

package xls

class Recruitment implements Serializable {

    String id
    String position
    String candidateName
    String noticePeriod
    String hrAgencyName
    String cellPhone
    String profileSourcingData
    String totalWorkExperience
    String emailAddress
    String currentCTC
    String expectedCTC
    String currentPosition
    String currentOrganisationName
    String communication
    String bankingOrFinancialDomainKnowledge
    String clientManagementExperience
    String reasonForChange
    String firstInterviewBy
    String secondInterviewBy
    String interviewStatus
    String offerDate
    String expectedDateOfJoining
    String joiningTeamName

    static constraints = {
         position(blank:true, nullable:true)
         candidateName(blank:true, nullable:true)
         noticePeriod(blank:true, nullable:true)
         hrAgencyName(blank:true, nullable:true)
         cellPhone(blank:true, nullable:true)
         profileSourcingData(blank:true, nullable:true)
         emailAddress(blank:true, nullable:true)
         totalWorkExperience(blank:true, nullable:true)
         currentCTC(blank:true, nullable:true)
         expectedCTC(blank:true, nullable:true)
         currentPosition(blank:true, nullable:true)
         currentOrganisationName(blank:true, nullable:true)
         communication(blank:true, nullable:true)
         bankingOrFinancialDomainKnowledge(blank:true, nullable:true)
         clientManagementExperience(blank:true, nullable:true)
         reasonForChange(blank:true, nullable:true)
         firstInterviewBy(blank:true, nullable:true)
         secondInterviewBy(blank:true, nullable:true)
         interviewStatus(blank:true, nullable:true)
         offerDate(blank:true, nullable:true)
         expectedDateOfJoining(blank:true, nullable:true)
         joiningTeamName(blank:true, nullable:true)
    }


    static mapping = {
            id generator:'assigned'

     }


}
4

2 回答 2

3

我在 Grails 2.2.0 应用程序中遇到了 java.lang.VerifyError,原因是 GSP 文件中注释掉的 Groovy 表达式显然使 Grails 缓存机制中断。删除注释掉的表达式解决了这个问题。

于 2013-12-04T06:51:03.377 回答
2

请检查编译和部署 jar 之间的版本冲突,特别是groovy-all.jar

于 2012-07-27T05:53:58.803 回答