Grails audit plugin无法使用MongoDB
尽管文档中提到它可以与mongoDB一起使用
兼容性问题
Grails 1.2.x及更低版本的用户应使用此插件的0.5.3版本。 Grails 1.3.x及更高版本的用户应使用此插件的0.5.5.3版本。如果您使用Grails> = 2.3,我们建议使用1.0.0或更高版本。
从版本1.0.0开始,此插件与ORM映射器无关,因此您可以将其与您选择的ORM映射器一起使用(Hibernate3,Hibernate4,MongoDB等)。
我有以下配置设置
BuildConfig.groovy
compile ":mongodb:3.0.3"
compile ":audit-logging:1.0.5"
注意:不使用任何Hibernate插件
启动应用程序的错误是:
Configuring Spring Security Core ...
... finished configuring Spring Security Core
2015-08-03 20:30:48,774 +0530 ERROR GrailsContextLoaderListener:213 - Error initializing the application: Cannot get property 'datastores' on null object
java.lang.NullPointerException: Cannot get property 'datastores' on null object
at org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:57)
at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:168)
at org.codehaus.groovy.runtime.callsite.NullCallSite.getProperty(NullCallSite.java:44)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:227)
at AuditLoggingGrailsPlugin$_closure1.doCall(AuditLoggingGrailsPlugin.groovy:106)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207)
at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
at groovy.lang.Closure.call(Closure.java:423)
at AuditLoggingGrailsPlugin$_closure1.call(AuditLoggingGrailsPlugin.groovy)
at org.codehaus.groovy.grails.plugins.DefaultGrailsPlugin.doWithApplicationContext(DefaultGrailsPlugin.java:488)
at org.codehaus.groovy.grails.plugins.AbstractGrailsPluginManager.doPostProcessing(AbstractGrailsPluginManager.java:176)
at org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator.performPostProcessing(GrailsRuntimeConfigurator.java:240)
at org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator.configure(GrailsRuntimeConfigurator.java:176)
at org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator.configure(GrailsRuntimeConfigurator.java:127)
at org.codehaus.groovy.grails.web.context.GrailsConfigUtils.configureWebApplicationContext(GrailsConfigUtils.java:126)
at org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener.initWebApplicationContext(GrailsContextLoaderListener.java:109)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4992)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5490)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Disconnected from the target VM, address: '127.0.0.1:35642', transport: 'socket'
我还找到了一个重定向到此链接的类似问题
http://stackoverflow.com/questions/23470095/grails-audit-logging-plugin-for-mongodb-is-not-working
答案 0 :(得分:0)
请尝试使用最新的1.0.6-SNAPSHOT版本。请参阅问题https://github.com/robertoschwald/grails-audit-logging-plugin/issues/91