我正在开发一个Play 2.1.1应用程序,在开发模式下没有任何问题(也就是run
命令,甚至是start
)。当我使用dist
命令将其投入生产时,问题就来了。我可以毫无问题地部署应用程序,但当我尝试发出任何请求时,ClassNotFoundException
会上升。
MacBook-:myproject-1.0-SNAPSHOT Marcos$ sh start
play server process ID is 6003
[info] play - Application started (Prod)
[info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
[error] play - Cannot invoke the action, eventually got an error: Java.lang.ClassNotFoundException: controllers.Application
[error] application -
! @6eo9pbl4f - Internal server error, for (GET) [/venuesList] ->
play.api.Application$$anon$1: Execution exception[[ClassNotFoundException: controllers.Application]]
at play.api.Application$class.handleError(Application.scala:289) ~[play.play_2.10-2.1.1.jar:2.1.1]
at play.api.DefaultApplication.handleError(Application.scala:383) [play.play_2.10-2.1.1.jar:2.1.1]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$handleAction$1$4$$anonfun$apply$28.apply(PlayDefaultUpstreamHandler.scala:403) [play.play_2.10-2.1.1.jar:2.1.1]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$handleAction$1$4$$anonfun$apply$28.apply(PlayDefaultUpstreamHandler.scala:403) [play.play_2.10-2.1.1.jar:2.1.1]
at scala.Option.map(Option.scala:145) [org.scala-lang.scala-library-2.10.0.jar:na]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$handleAction$1$4.apply(PlayDefaultUpstreamHandler.scala:403) [play.play_2.10-2.1.1.jar:2.1.1]
java.lang.ClassNotFoundException: controllers.Application
at java.net.URLClassLoader$1.run(URLClassLoader.java:366) ~[na:1.7.0_21]
at java.net.URLClassLoader$1.run(URLClassLoader.java:355) ~[na:1.7.0_21]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_21]
at java.net.URLClassLoader.findClass(URLClassLoader.java:354) ~[na:1.7.0_21]
at java.lang.ClassLoader.loadClass(ClassLoader.java:423) ~[na:1.7.0_21]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) ~[na:1.7.0_21]
它不适用于任何“获取”或“发布”。 任何想法?
编辑:我在相同的开发环境中尝试了生产版本(相同的机器,相同的操作系统,相同的播放安装)。我得到了同样的错误。包括完整的堆栈跟踪。