Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grails 2.4 throws EHCache class not found error

Tags:

grails

ehcache

I created a fresh Grails 2.4 project, removed hibernate and database migration plugin added latest spring security and mongo db plugin and when I ran grails compile I got following error

| Error Fatal error during compilation java.lang.NoClassDefFoundError: net/sf/ehcache/config/CacheConfiguration (Use --stacktrace to see the full trace)

If I remove spring security plugin it compiles and if I remove mongoDB plugin and use spring-security with hibernate it still works only the combination of spring security with solo mongoDB plugin is giving above error.

Any Idea ?

like image 643
Hussain Fakhruddin Avatar asked Jun 11 '14 13:06

Hussain Fakhruddin


1 Answers

Looks like spring-security depends on ehcache, but doesn't declare as such. We had a similar problem with the cache plugin depending on ehcache. Add this to the dependencies section of your BuildConfig:

compile "net.sf.ehcache:ehcache-core:2.4.8"
like image 116
Graeme Rocher Avatar answered Nov 06 '22 07:11

Graeme Rocher