Question

When upgrading to Play 2.2 I get the error

Exception: There is no cache plugin registered. Make sure at least one CachePlugin implementation is enabled

I understand that this means that there could be more than one cache on the classpath or none at all. I have tried removing cache from the dependencies and also excluding any play imports from the other dependencies but nothing has altered the error. If I remove cache and exclude("com.typesafe.play", "*") from all dependencies I correctly get java.lang.NoClassDefFoundError: play/api/cache/Cache

But as soon as I then add cache back back in I get the same error of no cache plugin registered.

My cache dependencies but running play dependencies | grep cache

| com.typesafe.play:play-cache_2.10:2.2.2-RC2 | rm-play:rm-play_2.10:1.0-SNAPSHOT                   | As play-cache_2.10.jar|
| net.sf.ehcache:ehcache-core:2.6.6| com.typesafe.play:play-cache_2.10:2.2.2-RC2| As ehcache-core.jar                      |
| com.typesafe.play:play_2.10:2.2.2-RC2| com.typesafe.play:play-cache_2.10:2.2.2-RC2| As play_2.10.jar| net.sf.ehcache:ehcache-core:2.6.6|  

My Build.scala

import sbt._
import Keys._
import play.Project._

object ApplicationBuild extends Build {

  val appName = "rm-play"
  val appVersion = "1.0-SNAPSHOT"

  val appDependencies = Seq(
    javaCore,
    javaJdbc,
    javaEbean,
    cache,
    //Group id
    "com.google.guava" % "guava" % "14.0.1" ,
    "com.dbdeploy" % "maven-dbdeploy-plugin" % "3.0M3",
    "postgresql" % "postgresql" % "9.1-901.jdbc4",
    "joda-time" % "joda-time" % "2.3",
    "com.amazonaws" % "aws-java-sdk"% "1.6.11",
    "ws.securesocial" %% "securesocial" % "master-SNAPSHOT" exclude("com.typesafe.play", "*")
    )

    val main = play.Project(appName, appVersion, appDependencies).settings(
    resolvers += Resolver.sonatypeRepo("snapshots"),
    resolvers += Resolver.sonatypeRepo("releases")
    )

}

plugin.sbt

// Comment to get more information during initialization
logLevel := Level.Warn

// The Typesafe repository
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"

// Use the Play sbt plugin for Play projects
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.2-RC2")
Was it helpful?

Solution

Ok so my problem was that in my application.conf file I had some cache properties left over from 2.0, commenting them out helped me get the above error.

#memcachedplugin=enabled
#memcached.namespace=srm
#ehcacheplugin=enabled
#memcached.host="127.0.0.1:11211"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top