引起:java.lang.ClassNotFoundException:javax.validation.Validation

时间:2014-07-04 11:55:52

标签: heroku playframework-2.0

我已将my play 2.0.8应用程序部署到heroku。当我输入heroku日志时,我得到:

2014-07-04T11:38:39.321512+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS:  -Djava.rmi.server.useCodebaseOnly=true
2014-07-04T11:38:39.958190+00:00 app[web.1]: Play server process ID is 2
2014-07-04T11:38:41.282180+00:00 app[web.1]: [info] play - database [default] connected at jdbc:postgresql://ec2-54-204-41-178.compute-1.amazonaws.com:5432/d7435ktoms6avl
2014-07-04T11:38:38.387319+00:00 heroku[web.1]: Starting process with command `target/start -Dhttp.port=39289 -Xmx384m -Xss512k -XX:+UseCompressedOops`
2014-07-04T11:38:43.908912+00:00 app[web.1]: [info] play - Application started (Prod)
2014-07-04T11:38:44.476224+00:00 app[web.1]: [info] play - Listening for HTTP on port 39289...
2014-07-04T11:38:45.156286+00:00 heroku[web.1]: State changed from starting to up
2014-07-04T11:38:47.194467+00:00 heroku[router]: at=info method=GET path="/" host=ejot-tezmak.herokuapp.com request_id=ef34ad0d-aa16-4238-b4a5-efe454eb5af6 fwd="88.248.183.158" dyno=web.1 connect=1ms service=628ms status=303 bytes=82
2014-07-04T11:38:47.646263+00:00 heroku[router]: at=info method=GET path="/login" host=ejot-tezmak.herokuapp.com request_id=8839b681-9612-4157-a82f-db639a51e680 fwd="88.248.183.158" dyno=web.1 connect=1ms service=99ms status=500 bytes=2049
2014-07-04T11:38:47.636611+00:00 app[web.1]: 
2014-07-04T11:38:47.636620+00:00 app[web.1]:    at akka.actor.ActorCell.invoke(ActorCell.scala:626) [akka-actor-2.0.2.jar:2.0.2]
2014-07-04T11:38:47.636624+00:00 app[web.1]:    at play.data.validation.Validation.<clinit>(Validation.java:16) ~[play_2.9.1-2.0.8.jar:2.0.8]
2014-07-04T11:38:47.636632+00:00 app[web.1]: Caused by: java.lang.ClassNotFoundException: javax.validation.Validation
2014-07-04T11:38:47.636625+00:00 app[web.1]:    at play.data.Form.field(Form.java:493) ~[play_2.9.1-2.0.8.jar:2.0.8]
2014-07-04T11:38:47.636634+00:00 app[web.1]:    at java.security.AccessController.doPrivileged(Native Method) ~[na:1.6.0_27]
2014-07-04T11:38:47.636639+00:00 app[web.1]:    at java.lang.ClassLoader.loadClass(ClassLoader.java:266) ~[na:1.6.0_27]
2014-07-04T11:38:47.636616+00:00 app[web.1]:    at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:115) [play_2.9.1-2.0.8.jar:2.0.8]
2014-07-04T11:38:47.636621+00:00 app[web.1]:    at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:197) [akka-actor-2.0.2.jar:2.0.2]
2014-07-04T11:38:47.636615+00:00 app[web.1]:    at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:134) [play_2.9.1-2.0.8.jar:2.0.8]
2014-07-04T11:38:47.636629+00:00 app[web.1]:    at views.html.login$$anonfun$apply$1.apply(login.template.scala:43) ~[tuncu_2.9.1-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
2014-07-04T11:38:47.636617+00:00 app[web.1]:    at akka.actor.Actor$class.apply(Actor.scala:318) [akka-actor-2.0.2.jar:2.0.2]
2014-07-04T11:38:47.636623+00:00 app[web.1]: Caused by: java.lang.NoClassDefFoundError: javax/validation/Validation
2014-07-04T11:38:47.636608+00:00 app[web.1]: 
2014-07-04T11:38:47.636633+00:00 app[web.1]:    at java.net.URLClassLoader$1.run(URLClassLoader.java:217) ~[na:1.6.0_27]
2014-07-04T11:38:47.636637+00:00 app[web.1]:    at java.lang.ClassLoader.loadClass(ClassLoader.java:321) ~[na:1.6.0_27]
2014-07-04T11:38:47.636612+00:00 app[web.1]: play.core.ActionInvoker$$anonfun$receive$1$$anon$1: Execution exception [[NoClassDefFoundError: javax/validation/Validation]]
2014-07-04T11:38:47.636635+00:00 app[web.1]:    at java.net.URLClassLoader.findClass(URLClassLoader.java:205) ~[na:1.6.0_27]
2014-07-04T11:38:47.636596+00:00 app[web.1]: [error] application - 
2014-07-04T11:38:47.636610+00:00 app[web.1]: ! @6imc0d77j - Internal server error, for request [GET /login] ->
2014-07-04T11:38:47.636619+00:00 app[web.1]:    at play.core.ActionInvoker.apply(Invoker.scala:113) [play_2.9.1-2.0.8.jar:2.0.8]
2014-07-04T11:38:47.636626+00:00 app[web.1]:    at play.data.Form.apply(Form.java:429) ~[play_2.9.1-2.0.8.jar:2.0.8]
2014-07-04T11:38:47.636638+00:00 app[web.1]:    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) ~[na:1.6.0_27]
2014-07-04T11:38:47.636628+00:00 app[web.1]:    at views.html.login$$anonfun$apply$1.apply(login.template.scala:58) ~[tuncu_2.9.1-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
2014-07-04T11:38:47.636630+00:00 app[web.1]:    at views.html.helper.form$.apply(form.template.scala:45) ~[play_2.9.1-2.0.8.jar:2.0.8]

我的本​​地系统一切正常。如何防止看到此错误消息?

1 个答案:

答案 0 :(得分:0)

也许你不习惯非托管图书馆。请检查一下。您可以在play中检查build.sbt文件。这个link对此非常有用。