简体   繁体   中英

Integrating Apache Shiro on Play framework 2.1

I'm trying to integrate Apache Shiro into Play framework 2.1 I'm using an open source project ( https://github.com/wsargent/play-shiro ) that support play framework 2.0

I've tried to migrate this application from play 2.0 into 2.1 but I keep getting these errors when I compile the project...

Does anyone know how to handle this errors?

[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] $ 

I've upgraded the code to 2.1, but please, please consider using Play Authenticate or SecureSocial instead. This code was never intended to be production quality.

After the upgrade from Play! 2.0 to Play! 2.1, have you ran the following commands?

play clean
play clean-files
play compile

That's usually the cause of those compilation issues.

If the problem persists, have a look at the migration guide to check if you actually followed all required steps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM