在为Grails 2.4.4配置Auditlog插件时找不到配置的AuditLog域错误

时间:2015-11-10 11:40:35

标签: grails logging audit

我正在尝试添加auditlog插件,但是当服务器明星我收到错误时,找不到配置的Auditlog域,服务器就会关闭。

[ERROR] 2015-11-10 15:22:04,561        org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener - Error initializing the application: Error creating bean with name 'org.codehaus.groovy.grails.plugins.orm.auditable.AuditLogEventController': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.codehaus.groovy.grails.plugins.orm.auditable.AuditLogEventController]: Constructor threw exception; nested exception is java.lang.IllegalStateException: Can't find configured AuditLog domain: groovy.util.ConfigObject@5bb5d623

org.springframework.beans.factory.BeanCreationException:创建名为'org.codehaus.groovy.grails.plugins.orm.auditable.AuditLogEventController'的bean时出错:bean的实例化失败;嵌套异常是org.springframework.beans.BeanInstantiationException:无法实例化bean类[org.codehaus.groovy.grails.plugins.orm.auditable.AuditLogEventController]:构造函数抛出异常;嵌套异常是java.lang.IllegalStateException:找不到已配置的AuditLog域:groovy.util.ConfigObject@5bb5d623     在java.util.concurrent.FutureTask.run(FutureTask.java:262)     在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)     at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:615)     在java.lang.Thread.run(Thread.java:745) 引起:org.springframework.beans.BeanInstantiationException:无法实例化bean类[org.codehaus.groovy.grails.plugins.orm.auditable.AuditLogEventController]:构造函数抛出异常;嵌套异常是java.lang.IllegalStateException:找不到已配置的AuditLog域:groovy.util.ConfigObject@5bb5d623

这就是我在buildconfig.groovy

中添加的内容
plugins {
    // plugins for the build system only
    build ":tomcat:7.0.55"
    compile ":audit-logging:1.1.0-SNAPSHOT"

1 个答案:

答案 0 :(得分:1)

如文档(http://plugins.grails.org/plugin/audit-logging)中所述,您必须执行

grails audit-quickstart your.package.YourAuditLogEvent>

在项目中创建audit-log Domain类,并在Config.groovy中配置此类。

BTW:已经发布了1.1.0。