0

Grails audit plugin is not working with the MongoDB

Even though it's mention in the documentation that it will work with mongoDB

Compatibility issues

Users of Grails 1.2.x and below should use version 0.5.3 of this plugin. Users of Grails 1.3.x and above should use version 0.5.5.3 of this plugin. If you use Grails >= 2.3 we recommend to use 1.0.0 or above.

Starting with version 1.0.0, this plugin is ORM mapper agnostic, so you can use it with the ORM mapper of your choice (Hibernate3, Hibernate4, MongoDB, etc.).

I have the following configuration setup

BuildConfig.groovy

compile ":mongodb:3.0.3"
compile ":audit-logging:1.0.5"

NOTE: not using any Hibernate plugin

Error I am getting on Starting the Application is:

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'

I also Found a similar question which redirects to this link

http://stackoverflow.com/questions/23470095/grails-audit-logging-plugin-for-mongodb-is-not-working

tim_yates
  • 167,322
  • 27
  • 342
  • 338
Ratan Kumar
  • 1,640
  • 3
  • 25
  • 52

1 Answers1

0

Please try with latest 1.0.6-SNAPSHOT version. See Issue https://github.com/robertoschwald/grails-audit-logging-plugin/issues/91

Bertl
  • 605
  • 5
  • 10