Last active
December 14, 2015 05:40
-
-
Save julienba/5037309 to your computer and use it in GitHub Desktop.
Redis error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package controllers | |
import play.api._ | |
import play.api.mvc._ | |
import play.api.cache.Cache | |
import play.api.Play.current | |
/** | |
* [warn] application - could not deserialize key:myobj ex:java.lang.ClassNotFoundException: controllers.Application$Adress | |
java.lang.ClassNotFoundException: controllers.Application$Adress | |
at java.net.URLClassLoader$1.run(URLClassLoader.java:202) | |
at java.security.AccessController.doPrivileged(Native Method) | |
at java.net.URLClassLoader.findClass(URLClassLoader.java:190) | |
at java.lang.ClassLoader.loadClass(ClassLoader.java:306) | |
*/ | |
object Application extends Controller { | |
case class Adress(town: String) | |
case class Person(name: String, adresses: List[Adress]) | |
def index = Action { | |
val alice = Person("alice", List(Adress("Paris"))) | |
Cache.set("myobj", alice) | |
val o3 = Cache.getAs[Person]("myobj") | |
println("result: " + o3) | |
Ok(views.html.index("Your new application is ready.")) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment