Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Grails运行时异常与审计日志插件_Grails - Fatal编程技术网

Grails运行时异常与审计日志插件

Grails运行时异常与审计日志插件,grails,Grails,我已经通过CloudFoundry将我的应用程序部署到运行在EC2上的tomcat上。应用程序使用 我收到以下运行时错误: Error 500: Executing action [save] of controller [com.questern.aoms.CompanyController] caused exception: groovy.lang.MissingPropertyException: No such property: errors for class: org.codeh

我已经通过CloudFoundry将我的应用程序部署到运行在EC2上的tomcat上。应用程序使用

我收到以下运行时错误:

Error 500: Executing action [save] of controller [com.questern.aoms.CompanyController] caused exception: groovy.lang.MissingPropertyException: No such property: errors for class: org.codehaus.groovy.grails.plugins.orm.auditable.AuditLogEvent 
Servlet: grails 
URI: /aoms/grails/company/save.dispatch 
Exception Message: No such property: errors for class: org.codehaus.groovy.grails.plugins.orm.auditable.AuditLogEvent 
Caused by: No such property: errors for class: org.codehaus.groovy.grails.plugins.orm.auditable.AuditLogEvent 
Class: CompanyController 
At Line: [30] 
例外情况是:

groovy.lang.MissingPropertyException: No such property: errors for class: org.codehaus.groovy.grails.plugins.orm.auditable.AuditLogEvent 

    at $Proxy10.saveOrUpdate(Unknown Source) 

    at com.questern.aoms.CompanyController$_closure4.doCall(CompanyController.groovy:30) 

    at com.questern.aoms.CompanyController$_closure4.doCall(CompanyController.groovy) 
我已将import语句添加到controller CompanyController,但没有效果

import org.codehaus.groovy.grails.plugins.orm.auditable.AuditLogEvent 
我检查了war文件,AuditLogEvent包含在:

aoms-0.1.war\WEB-INF\classes\org\codehaus\groovy\grails\plugins\orm\auditable\ 

关于问题可能是什么有什么建议吗

AuditLogEvent是审计日志插件中包含的域类

您不需要直接创建此类的实例来获取插件的日志功能。通过在要审核的域对象中设置以下字段,让插件为您完成工作

static auditable = true
在我看来,您可能正在尝试自己创建和保存域类的实例

我已将导入语句添加到 控制器公司控制器,但 无济于事


如果要审核的域对象是“Company”,则尝试只添加上述“auditable”字段,并删除项目中对“AuditLogEvent”的所有直接引用。

在我看来,您的部署可能已损坏。尝试退出所有IDE,然后运行

grails clean
然后

或者,您可以选择创建和部署什么

有时我发现使用STS(Eclipse和Grails插件)战争失败了(正如您上面提到的)


希望这有帮助。

您能提供CompanyController.groovy第30行的代码吗?谢谢您的回复。我的代码中没有对AuditLogEvent的直接引用。我在上的FAQ中看到了导入的内容。我想我已经按照文档中的说明和您在上面概述的那样实施了审计日志记录。
grails war