We've recently started the upgrade to our Play! instances, from 2.0.4 to 2.1. One of the things that has stumped the migration so far is an issue that we seem to have with multiple instances of the global plugins being loaded. So if I debug start up in order to attain a list of the plugins that are loaded when play starts, I get two of everything. This isn't much of an issue for most of them, but for EhCache (which is a singleton and throws an exception if more than one instance with name 'play' is created), it's causing rather a headache.
I've seen various issues that seem to have a similar error being thrown to the one that we are:
Stack Trace:
sbt.ForkMain$ForkError: Cache play already exists
at net.sf.ehcache.CacheManager.addCache(CacheManager.java:1163)
at play.api.cache.EhCachePlugin.x$1$lzycompute(Cache.scala:122)
at play.api.cache.EhCachePlugin.x$1(Cache.scala:120)
at play.api.cache.EhCachePlugin.cache$lzycompute(Cache.scala:120)
at play.api.cache.EhCachePlugin.cache(Cache.scala:120)
at play.api.cache.EhCachePlugin.onStart(Cache.scala:138)
at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:63)
at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:63)
at scala.collection.immutable.List.foreach(List.scala:309)
at play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:63)
at play.api.Play$$anonfun$start$1.apply(Play.scala:63)
at play.api.Play$$anonfun$start$1.apply(Play.scala:63)
at play.utils.Threads$.withContextClassLoader(Threads.scala:18)
at play.api.Play$.start(Play.scala:62)
at play.api.Play.start(Play.scala)
at play.test.Helpers.start(Helpers.java:350)
And all seem to suggest that it's either caused by multiple declarations of the plugin, or duplicate entries for the play jar on the classpath. I can't find any evidence of either of these cases though. We're using the EhCache in a separate play project that is compiled into the main project. I thought that this could be the problem, but from what I can see, we've only the one reference.
Is it possible that the issue is something to do with the project inclusion? Or am I missing something glaringly obvious?
Thanks in advance for the help,
Suche