Sunday, April 28, 2013

[Resolved] Could not create a new instance of class [HibernateGrailsPlugin]!

After I upgraded my Grails app from 1.3.7 to 2.1.0, I can compile it, run app in development mode successfully, But failed to deploy it in tomcat.

I get the following error when I put war file in tomcat and start it:

Could not create a new instance of class [HibernateGrailsPlugin]!
........
Caused by: groovy.lang.MissingPropertyException: No such property: onChange for class: org.codehaus.groovy.grails.plugins.orm.hibernate.H ibernatePluginSupport


I was struggling with this issue for almost two days, and finally resolve it.

In Grails 1.3.7, org.codehaus.groovy.grails.plugins.orm.hibernate.H ibernatePluginSupport is included in grails-gorm plugin, and you can find that the latest version of gorm package is 1.3.7.

There is no any newer version for this plugin, because in later version of Grails, this class is not included in grails-gorm.jar, but in grails-hibernate-2.x.jar.

So the solution cloud be very simple, I should find the problem maker (grails-gorm 1.3.7 jar) and remove it in my dependency. 

I find that in my app, the other engineers (who created this project one year ago) use both maven and grails to manage dependencies and build project, and there is dependency entry for gorm 1.3.7 in pom file. Then, life is easy, just clean up pom file and recompile it. 


DONE!

Please do not use both maven and grails to manage dependencies and build project in the same time.

1 comment:

  1. Persistent state refers to passive features on some slot machines, some of which place to} trigger bonus payouts or other particular features if certain conditions are met over time by players on that machine. A slot machine's normal layout includes a display screen displaying three or extra reels that "spin" when the game is activated. Some trendy slot machines still include a lever as a skeuomorphic design trait to trigger play. However, the mechanics of early machines have been outdated by random quantity generators, 카지노 사이트 and most at the moment are|are actually} operated utilizing buttons and touchscreens. With almost 700 ready-to-pay slots, The Mill Casino welcomes you to strive your hand at a recreation of chance.

    ReplyDelete