Your stack trace indicates that the exception is being thrown from Play Framework code that tries to programmatically create a cache called "play". As the EhCache documentation explains:
When you try to programmatically add a cache by name,
CacheManager.add(String name)
, a default cache is expected to exist in the CacheManager configuration. To fix this error, add a defaultCache to the CacheManager's configuration.
The fix is simple enough - make sure the ehcache.xml
file you are using has a defaultcache
element (you can see what a defaultcache
element looks like in Play 2.1's default Ehcache configuration). The key question that still needs addressing is which configuration file is being used when you start up your application:
If you've included an
ehcache.xml
file in theconf
directory in your application, make sure it has adefaultcache
element. Alternatively, if you don't have any of your own custom configuration in this file, you can considering deleting it and falling back to using Play's default configuration.If you don't have your own
ehcache.xml
file, search over the JAR files in yourstaged
directory and see if any contain anehcache.xml
file.
As for why the error happens in some circumstances and not others, I would venture that there are classpath ordering differences between the various commands. This means that some commands will choose Play's internal Ehcache configuration (with the server then starting up cleanly), whereas others will load an incorrect Ehcache configuration file and spew out errors.