[2.1.0-Scala] Two copies of each of the play provided plugins being loaded, causing EhCache to throw an error

96 views
Skip to first unread message

Suchema Oyetey

unread,
Feb 26, 2013, 6:35:39 PM2/26/13
to play-fr...@googlegroups.com
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

Brian Smith

unread,
Feb 26, 2013, 6:48:29 PM2/26/13
to play-fr...@googlegroups.com
I wonder if your issue is related to this thread?


See Guillaume's comment there.

Hope that helps

Brian

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Suchema Oyetey

unread,
Feb 27, 2013, 6:20:04 AM2/27/13
to play-fr...@googlegroups.com
That was exactly the issue - we had a plugin that had a hard dependency on 2.0.3 in the build. Thanks for the heads up, that question didn't turn up in any of my searches, it was driving me crazy!
Reply all
Reply to author
Forward
0 new messages