Google Groups

Re: _ [2.0] EhCachePlugin error: "Cache play already exists", when deploying a "play dist" build


peter hausel Mar 31, 2012 1:50 PM
Posted in group: play-framework
Hi,

i just tested it using our integration test and it worked for me.

Your error seems to indicate that you may have two EhCachePlugin configured, so please make sure
you do not have a second plugin registered somewhere (ie in your play.plugins).

Thanks,
Peter

On Saturday, March 31, 2012 4:32:51 PM UTC-4, KajMagnus wrote:
Hi

I'm getting an "Cache play already exists" in EhCachePlugin when I
deploy my Play 2 app on my production machine.
I deploy by building Play with "play dist" and unzipping the generated
zip file and rsync:ing it to the production server.

I've worked around the problem by disabling the ehcache, in the
application.conf file, like so:
ehcacheplugin=disabled
(( But perhaps soon you'll need to specify:
ehcacheplugin.enabled=false
ehcacheplugin.disabled=true
instead, because there's either a documentation bug or a code bug in
EhCachePlugin. ))

(Perhaps someone else runs into the same problem,
or perhaps the Play 2 devs aren't aware about it yet,
hence this email.)

(I found some old threads related to Play 1 when I searched for "Cache
play already exists", but I got the impression that that issue had
already been fixed. So perhaps that was another issue.)


Here's the error and stack trace:

    [ec2-user@dw0azewdbpv11danny debiki.se]$ Play server process ID is
1387
    Oops, cannot start the server.
    net.sf.ehcache.ObjectExistsException: Cache play already exists
      at net.sf.ehcache.CacheManager.addCache(CacheManager.java:990)
      at play.api.cache.EhCachePlugin.x$3(Cache.scala:111)
      at play.api.cache.EhCachePlugin.cache(Cache.scala:109)
      at play.api.cache.EhCachePlugin.onStart(Cache.scala:127)
      at play.api.Play$$anonfun$start$1.apply(Play.scala:60)
      at play.api.Play$$anonfun$start$1.apply(Play.scala:60)
      at scala.collection.LinearSeqOptimized
$class.foreach(LinearSeqOpti...
      at scala.collection.immutable.List.foreach(List.scala:45)
      at play.api.Play$.start(Play.scala:60)
      at play.core.StaticApplication.<init>(ApplicationProvider.scala:
51)
      at play.core.server.NettyServer$.createServer(NettyServer.scala:
132)
      at play.core.server.NettyServer$$anonfun$main
$5.apply(NettyServer...
      at play.core.server.NettyServer$$anonfun$main
$5.apply(NettyServer...
      at scala.Option.map(Option.scala:133)
      at play.core.server.NettyServer$.main(NettyServer.scala:152)
      at play.core.server.NettyServer.main(NettyServer.scala)


Best regards, KajMagnus