Search code examples
javaspringgrailsaclehcache

Error initializing the application with Spring Security: net/sf/ehcache/Ehcache not found


I want to use the Spring Security ACL plugin with mongodb.

When I run my app I get the following error:

2014-06-15 14:08:04,325 [localhost-startStop-1] ERROR context.GrailsContextLoader  - Error initializing the application: net/sf/ehcache/Ehcache
Message: net/sf/ehcache/Ehcache
    Line | Method
->> 2451 | privateGetDeclaredMethods in java.lang.Class
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|   1810 | getDeclaredMethods        in     ''
|    334 | innerRun . . . . . . . .  in java.util.concurrent.FutureTask$Sync
|    166 | run                       in java.util.concurrent.FutureTask
|   1145 | runWorker . . . . . . . . in java.util.concurrent.ThreadPoolExecutor
|    615 | run                       in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run . . . . . . . . . . . in java.lang.Thread
Caused by ClassNotFoundException: net.sf.ehcache.Ehcache
->>  175 | findClass                 in org.codehaus.groovy.tools.RootLoader
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    423 | loadClass                 in java.lang.ClassLoader
|    147 | loadClass . . . . . . . . in org.codehaus.groovy.tools.RootLoader
|    356 | loadClass                 in java.lang.ClassLoader
|   2451 | privateGetDeclaredMethods in java.lang.Class
|   1810 | getDeclaredMethods        in     ''
|    334 | innerRun . . . . . . . .  in java.util.concurrent.FutureTask$Sync
|    166 | run                       in java.util.concurrent.FutureTask
|   1145 | runWorker . . . . . . . . in java.util.concurrent.ThreadPoolExecutor
|    615 | run                       in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run . . . . . . . . . . . in java.lang.Thread

How should I run this?


Solution

  • You are missing the ehcache.jar in your setup, or there are several of them, causing the version conflict.

    You can find the latest ehcache.jar on the Maven repository