Grails, Hibernate Event Listeners and ArrayStoreException

The Problem

Trying to register few Hibernate event listeners from plugin, But some how, registering the custom event listeners causes ArrayStoreException at runtime.

In plugin class

 def doWithSpring = {
	sanitizeHtmlListner(SanitizeHtmlListner)
	hibernateEventListeners(HibernateEventListeners) {
		listenerMap = ['save':sanitizeHtmlListner]
	}
    }

Listener class

class SanitizeHtmlListner implements SaveOrUpdateEventListener {
-----
}

Exception

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageSource': Initialization o
f bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with nam
e 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory';
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFacto
ry': Invocation of init method failed; nested exception is java.lang.ArrayStoreException
        at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:391)
        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)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageSource': Initi
alization of bean failed; nested exception is

Solution

No solution is known,

This is a bug in Grails, which will not let you register SaveAndUpdateListener,  and if you do, you get this error. if you try with pre-insert, pre-update listeners it should work. I don’t know what other listeners are affected.

Reported http://jira.grails.org/browse/GRAILS-7576

See

http://grails.1312388.n4.nabble.com/Hibernate-listeners-are-not-called-for-integration-tests-td3546387.html
http://grails.1312388.n4.nabble.com/Hibernate-event-listeners-td3483795.html

A simple grails CMS inspired from drupal

I am working on creating a new CMS based on grails. The purpose is to use it for a new site I am going to launch in near future.

Features
I really like drupal, and I want not all but similar features in my CMS.

  • Create/Edit/View/Delete nodes
  • Spaces (eg news, announcements)
  • Blocks
  • Regions
  • URL aliases
  • Make creating custom content type easy
  • Comments
  • Full text search
  • File upload

No plugin architecture, revisions or full support for themes initially.

Why not weceem or any other existing CMS

Just because I want to develop my own so that I understand it and i have full flexibility.

If you have any comments/suggestions please comment here.