/ / Integracja Apache Shiro w Play Framework 2.1 - apache, frameworki, playframework-2.1, shiro

Integracja Apache Shiro na platformie Play 2.1 - apache, frameworks, playframework-2.1, shiro

Próbuję zintegrować Apache Shiro ze środowiskiem Play 2.1 Korzystam z projektu open source (https://github.com/wsargent/play-shiro) obsługujące Play Framework 2.0

Próbowałem przenieść tę aplikację z play 2.0 do 2.1, ale wciąż pojawiają się te błędy podczas kompilacji projektu ...

Czy ktoś wie, jak sobie z tym poradzić?

[play-shiro] $ compile
[info] Updating {file:/Users/shai/Documents/Projects/opensource/play-shiro/}play-shiro...
[info] Done updating.
[info] Compiling 13 Scala sources and 1 Java source to /Users/shai/Documents/Projects/opensource/play-shiro/target/scala-2.10/classes...
[error] /Users/shai/Documents/Projects/opensource/play-shiro/app/views/login.scala.html:0: not found: type Flash
[error] /Users/shai/Documents/Projects/opensource/play-shiro/app/views/login.scala.html:1: not found: type Flash
[error] @(form: Form[(String,String)])(implicit flash: Flash)
[error]                                               ^
[error] /Users/shai/Documents/Projects/opensource/play-shiro/app/controllers/Login.scala:36: type mismatch;
[error]  found   : play.api.data.Form[(String, String)]
[error]  required: play.data.Form[(String, String)]
[error]     Ok(html.login(loginForm))
[error]                   ^
[error] /Users/shai/Documents/Projects/opensource/play-shiro/app/controllers/Login.scala:44: type mismatch;
[error]  found   : play.api.data.Form[(String, String)]
[error]  required: play.data.Form[(String, String)]
[error]       formWithErrors => { BadRequest(html.login(formWithErrors)) },
[error]                                                 ^
[error] /Users/shai/Documents/Projects/opensource/play-shiro/app/views/register.scala.html:0: not found: type Flash
[error] /Users/shai/Documents/Projects/opensource/play-shiro/app/views/register.scala.html:1: not found: type Flash
[error] @(form: Form[(String,String)])(implicit flash: Flash)
[error]                                               ^
[error] /Users/shai/Documents/Projects/opensource/play-shiro/app/controllers/Register.scala:30: type mismatch;
[error]  found   : play.api.data.Form[(String, String)]
[error]  required: play.data.Form[(String, String)]
[error]     Ok(html.register(registerForm))
[error]                      ^
[error] /Users/shai/Documents/Projects/opensource/play-shiro/app/controllers/Register.scala:37: type mismatch;
[error]  found   : play.api.data.Form[(String, String)]
[error]  required: play.data.Form[(String, String)]
[error]           BadRequest(html.login(formWithErrors))
[error]                                 ^
[error] /Users/shai/Documents/Projects/opensource/play-shiro/app/views/login.scala.html:19: value map is not a member of play.data.validation.ValidationError
[error]             @form.globalError.map { error =>
[error]                               ^
[error] /Users/shai/Documents/Projects/opensource/play-shiro/app/views/login.scala.html:53: not found: type Flash
[error] /Users/shai/Documents/Projects/opensource/play-shiro/app/views/login.scala.html:55: not found: type Flash
[error] /Users/shai/Documents/Projects/opensource/play-shiro/app/views/register.scala.html:18: value map is not a member of play.data.validation.ValidationError
[error]   @form.globalError.map { error =>
[error]                     ^
[error] /Users/shai/Documents/Projects/opensource/play-shiro/app/views/register.scala.html:51: not found: type Flash
[error] /Users/shai/Documents/Projects/opensource/play-shiro/app/views/register.scala.html:53: not found: type Flash
[error] 14 errors found
[error] (compile:compile) Compilation failed
[error] Total time: 3 s, completed Apr 17, 2013 7:00:42 PM
[play-shiro] $

Odpowiedzi:

3 dla odpowiedzi № 1

Zaktualizowałem kod do wersji 2.1, ale proszę rozważ zamiast tego użycie Play Authenticate lub SecureSocial. Ten kod nigdy nie miał służyć jakości produkcyjnej.


0 dla odpowiedzi nr 2

Po aktualizacji z Play! 2.0 do gry! 2.1, czy uruchomiłeś następujące polecenia?

play clean
play clean-files
play compile

To jest zwykle przyczyna problemów z kompilacją.

Jeśli problem nie ustąpi, zapoznaj się z plikiem przewodnik migracji aby sprawdzić, czy faktycznie wykonałeś wszystkie wymagane kroki.