/* ... */
override def onStop() {
if (play.api.Play.isTest(app)) {
cache.flush()
} else {
// shutdown of the cache manager in dev/prod mode
if (loaded) {
manager.shutdown()
}
}
Logger.info("Stopped Cache Plugin")
}
Stacktrace of the symptom described above:
java.lang.ExceptionInInitializerError: null
at Routes$$anonfun$routes$1$$anonfun$applyOrElse$219$$anonfun$apply$219.apply(routes_routing.scala:3078) ~[na:na]
at Routes$$anonfun$routes$1$$anonfun$applyOrElse$219$$anonfun$apply$219.apply(routes_routing.scala:3078) ~[na:na]
at play.core.Router$HandlerInvoker$$anon$5.call(Router.scala:180) ~[play_2.10.jar:2.1.4]
at play.core.Router$Routes$class.invokeHandler(Router.scala:371) ~[play_2.10.jar:2.1.4]
at Routes$.invokeHandler(routes_routing.scala:15) ~[na:na]
at Routes$$anonfun$routes$1$$anonfun$applyOrElse$219.apply(routes_routing.scala:3078) ~[na:na]
Caused by: net.sf.ehcache.CacheException: java.lang.ClassNotFoundException: com.obfuscated.package.geo.AdministrativeArea
at net.sf.ehcache.store.disk.DiskStorageFactory.retrieve(DiskStorageFactory.java:916) ~[ehcache-core.jar:na]
at net.sf.ehcache.store.disk.Segment.decodeHit(Segment.java:183) ~[ehcache-core.jar:na]
at net.sf.ehcache.store.disk.Segment.get(Segment.java:221) ~[ehcache-core.jar:na]
at net.sf.ehcache.store.disk.DiskStore.get(DiskStore.java:489) ~[ehcache-core.jar:na]
at net.sf.ehcache.store.disk.DiskStore.getQuiet(DiskStore.java:496) ~[ehcache-core.jar:na]
at net.sf.ehcache.store.FrontEndCacheTier.getQuiet(FrontEndCacheTier.java:230) ~[ehcache-core.jar:na]
Caused by: java.lang.ClassNotFoundException: com.obfuscated.package.geo.AdministrativeArea
at java.net.URLClassLoader$1.run(URLClassLoader.java:366) ~[na:1.7.0_51]
at java.net.URLClassLoader$1.run(URLClassLoader.java:355) ~[na:1.7.0_51]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_51]
at java.net.URLClassLoader.findClass(URLClassLoader.java:354) ~[na:1.7.0_51]
at java.lang.ClassLoader.loadClass(ClassLoader.java:425) ~[na:1.7.0_51]
at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ~[na:1.7.0_51]
IllegalStateException: The play Cache is not alive (STATUS_SHUTDOWN) (Cache.java:4267)
I have my example setup here :
https://github.com/anjanpathak/Angularjs-Auth
This is just a copy of https://github.com/mariussoutier/PlayBasics/tree/master/AngularJS-Auth but with a ApplicationSpec test.
The test however does run if I change the the following at https://github.com/anjanpathak/Angularjs-Auth/blob/master/app/controllers/Application.scala
implicit val app: play.api.Application = play.api.Play.current
to
implicit def app: play.api.Application = play.api.Play.current
But I am worried as this could lead to a performance hit. The app will be evaluated every time this code is executed which potentially could be for every request in my case.
Cheers,
Anjan