leon/play-salat

Error on Play 2.4

kormoglaz opened this issue · 9 comments

Hi, I'm using your library.
When I compile my project I got:

[error] missing or invalid dependency detected while loading class file 'Binders.class'.
[error] Could not access type JavascriptLitteral in package play.api.mvc,
[error] because it (or its dependencies) are missing. Check your build definition for
[error] missing or conflicting dependencies. (Re-run with -Ylog-classpath to see the problematic classpath.)
[error] A full rebuild may help if 'Binders.class' was compiled against an incompatible version of play.api.mvc.

My built.sbt is:

name := """panorama-settings"""

version := "1.0-SNAPSHOT"

lazy val root = (project in file(".")).enablePlugins(PlayScala)

scalaVersion := "2.11.6"

lazy val dbD = Seq(
"org.mongodb" %% "casbah" % "2.8.0",
"com.typesafe.play.plugins" %% "play-plugins-redis" % "2.3.1",
"com.novus" %% "salat" % "1.9.9",
"se.radley" %% "play-plugins-salat" % "1.5.0" // ORM for mongo
)

libraryDependencies ++= Seq(
jdbc,
cache,
ws,
specs2 % Test
) ++ dbD

routesImport += "se.radley.plugin.salat.Binders._"

TwirlKeys.templateImports += "org.bson.types.ObjectId"

resolvers += "scalaz-bintray" at "http://dl.bintray.com/scalaz/releases"

resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"

// Play provides two styles of routers, one expects its actions to be injected, the
// other, legacy style, accesses its actions statically.
routesGenerator := InjectedRoutesGenerator

Also getting this error, a quick search reveals it to be due to play.api.mvc changing the spelling:
JavascriptLitteral --> JavascriptLiteral

The error is on Binders.scala:42

+1. any ideas hot to fix it?

+1. same problem

Any progress?

leon commented

I'm not actively working on this project. If anyone feels they want to carry the torch they are welcome to take over.

The plugin needs migrated to a module to work with 2.4 https://www.playframework.com/documentation/2.4.x/PluginsToModules

In Play 2.4, that trait has been renamed JavascriptLiteral, with one "t", to fix the spelling. Here is my commit to it martende@aeaaff6
it works but actually break compilation for old versions

@martende How can I get your build? Do I need to recompile your code?

@angeloh: you can clone my version. and make 'sbt publish-local' and than use this version I don't know where can I put public libs that sbt understand.