play-salat icon indicating copy to clipboard operation
play-salat copied to clipboard

Error on Play 2.4

Open kormoglaz opened this issue 9 years ago • 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

kormoglaz avatar Jun 19 '15 05:06 kormoglaz

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

dtgartman avatar Aug 02 '15 22:08 dtgartman

+1. any ideas hot to fix it?

vitaly-rozman avatar Aug 05 '15 04:08 vitaly-rozman

+1. same problem

marius-carp avatar Sep 18 '15 14:09 marius-carp

Any progress?

antonstamov avatar Sep 30 '15 12:09 antonstamov

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

leon avatar Sep 30 '15 14:09 leon

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

danmassie avatar Oct 14 '15 15:10 danmassie

In Play 2.4, that trait has been renamed JavascriptLiteral, with one "t", to fix the spelling. Here is my commit to it https://github.com/martende/play-salat/commit/aeaaff602f91c9f02681f9afd7cefe1df869e234 it works but actually break compilation for old versions

martende avatar Nov 17 '15 20:11 martende

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

angeloh avatar Nov 24 '15 20:11 angeloh

@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.

martende avatar Nov 24 '15 21:11 martende