Platform-core[1.0.RC2] Event Listeners are not working

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Platform-core[1.0.RC2] Event Listeners are not working

harshin
Here is my code in my controller:
   def index = {

        println "Events...."
        event(for:"enovate", topic:'iamin',data:User.get(1))
       
    }

Here is my code in my service:
   @grails.events.Listener(topic = 'iamin', namespace = 'enovate')
    def myMethod(User user){

       log.info "Listeners "
    }

When i start my app i get the below exception:

    2012-12-13 18:32:55,093 [main] INFO  events.EventsImpl  - Reloading events listeners
    2012-12-13 18:32:55,109 [main] ERROR plugins.DefaultGrailsPluginManager  - Error configuring dynamic    
    methods for plugin [platformCore:1.0.RC2]: null
    java.lang.NullPointerException
        at org.grails.plugin.platform.util.PluginUtils.findAppPlugin(PluginUtils.groovy:29)
        at org.grails.plugin.platform.util.PluginUtils$findAppPlugin.callStatic(Unknown Source)
        at org.grails.plugin.platform.util.PluginUtils$findAppPlugin.callStatic(Unknown Source)
        at org.grails.plugin.platform.util.PluginUtils.getNameOfDefiningPlugin(PluginUtils.groovy:48)
        at org.grails.plugin.platform.util.PluginUtils$getNameOfDefiningPlugin.call(Unknown Source)
        at org.grails.plugin.platform.events.EventsImpl.eachListener(EventsImpl.groovy:187)
        at org.grails.plugin.platform.events.EventsImpl$eachListener.callCurrent(Unknown Source)
        at org.grails.plugin.platform.events.EventsImpl.registerListeners(EventsImpl.groovy:211)
        at org.grails.plugin.platform.events.EventsImpl$registerListeners.callCurrent(Unknown Source)
        at org.grails.plugin.platform.events.EventsImpl.reloadListeners(EventsImpl.groovy:252)
        at org.grails.plugin.platform.events.EventsImpl$reloadListeners.call(Unknown Source)
        at PlatformCoreGrailsPlugin$_closure3.doCall(PlatformCoreGrailsPlugin.groovy:196)
        at org.grails.tomcat.TomcatServer.start(TomcatServer.groovy:212)
        at grails.web.container.EmbeddableServer$start.call(Unknown Source)
        at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy:158)
        at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy)
        at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:280)
        at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
        at _GrailsRun_groovy$_run_closure5.doCall(_GrailsRun_groovy:149)
        at _GrailsRun_groovy$_run_closure5.call(_GrailsRun_groovy)
        at _GrailsRun_groovy.runInline(_GrailsRun_groovy:116)
        at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy)
        at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:59)
        at RunApp$_run_closure1.doCall(RunApp.groovy:33)
        at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
        at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
        at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
        at gant.Gant.withBuildListeners(Gant.groovy:427)
        at gant.Gant.this$2$withBuildListeners(Gant.groovy)
        at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
        at gant.Gant.dispatch(Gant.groovy:415)
        at gant.Gant.this$2$dispatch(Gant.groovy)
        at gant.Gant.invokeMethod(Gant.groovy)
        at gant.Gant.executeTargets(Gant.groovy:590)
        at gant.Gant.executeTargets(Gant.groovy:589)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:115)

When ever i make some changes in the Listener code in my service i get the below exception:
       
       2012-12-13 18:32:12,875 [Thread-132] INFO  events.EventsImpl  - Clear event listeners from class
       com.pochys.lrnr.web.assessment.AssessmentService
       2012-12-13 18:32:12,875 [Thread-132] INFO  events.EventsImpl  - events removed : 0
       Exception in thread "Thread-132" java.lang.NullPointerException
        at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.acceptGetProperty(PogoGetPropertySite.java:32)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:235)
        at org.grails.plugin.platform.util.PluginUtils.findAppPlugin(PluginUtils.groovy:29)
        at org.grails.plugin.platform.util.PluginUtils$findAppPlugin.callStatic(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:48)
        at org.grails.plugin.platform.util.PluginUtils$findAppPlugin.callStatic(Unknown Source)
        at org.grails.plugin.platform.util.PluginUtils.getNameOfDefiningPlugin(PluginUtils.groovy:48)
        at org.grails.plugin.platform.util.PluginUtils$getNameOfDefiningPlugin.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
        at org.grails.plugin.platform.util.PluginUtils$getNameOfDefiningPlugin.call(Unknown Source)
        at org.grails.plugin.platform.events.EventsImpl.eachListener(EventsImpl.groovy:187)
        at org.grails.plugin.platform.events.EventsImpl$eachListener.callCurrent(Unknown Source)
        at org.grails.plugin.platform.events.EventsImpl.registerListeners(EventsImpl.groovy:211)
        at org.grails.plugin.platform.events.EventsImpl$registerListeners.callCurrent(Unknown Source)
        at org.grails.plugin.platform.events.EventsImpl.reloadListener(EventsImpl.groovy:173)
        at org.grails.plugin.platform.events.EventsImpl$reloadListener.call(Unknown Source)
        at PlatformCoreGrailsPlugin$_closure9.doCall(PlatformCoreGrailsPlugin.groovy:267)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)
        at groovy.lang.Closure.call(Closure.java:282)
        at org.codehaus.groovy.grails.plugins.DefaultGrailsPlugin.invokeOnChangeListener(DefaultGrailsPlugin.java:1063)
        at org.codehaus.groovy.grails.plugins.DefaultGrailsPlugin.notifyOfEvent(DefaultGrailsPlugin.java:1014)
        at org.codehaus.groovy.grails.plugins.DefaultGrailsPluginManager.informObservers(DefaultGrailsPluginManager.java:268)
        at org.codehaus.groovy.grails.plugins.DefaultGrailsPlugin.notifyOfEvent(DefaultGrailsPlugin.java:1031)
        at org.codehaus.groovy.grails.plugins.DefaultGrailsPlugin.fireModifiedEvent(DefaultGrailsPlugin.java:904)
        at org.codehaus.groovy.grails.plugins.DefaultGrailsPlugin.checkForChanges(DefaultGrailsPlugin.java:752)
        at org.codehaus.groovy.grails.plugins.DefaultGrailsPluginManager.checkForChanges(DefaultGrailsPluginManager.java:645)
        at org.codehaus.groovy.grails.plugins.DefaultGrailsPluginManager$GrailsPluginChangeChecker$1.run(DefaultGrailsPluginManager.java:1897)