我在Heroku上运行了一个Play Framework 2.1.1应用程序。
我在本地开发环境中编写了一堆新代码,它工作正常,但是当我将它部署到Heroku时,应用程序崩溃了,我在日志中得到了这个:
Configuration error: Configuration error[Cannot register class [models.Article] in Ebean server]
Oops, cannot start the server.
...
Caused by: java.lang.NoClassDefFoundError: com/avaje/ebean/bean/EnhancedTransactional
...
Caused by: java.lang.ClassNotFoundException: com.avaje.ebean.bean.EnhancedTransactional
...
Process exited with status 255
State changed from starting to crashed
当我从模型中删除@Transactional注释时,我不再收到错误。
以下是我在其中一个模型中使用@Transactional的示例:
@Transactional
public static Product find(Long id) {
return find.byId(String.valueOf(id));
}
有没有人经历过这个或者知道为什么它在本地工作正常,但在Heroku中没有?
根据请求,这是我的build.scala
import sbt._
import Keys._
import play.Project._
object ApplicationBuild extends Build {
val appName = "myapp"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
// Add your project dependencies here,
"postgresql" % "postgresql" % "8.4-702.jdbc4",
"com.typesafe" %% "play-plugins-mailer" % "2.1.0",
"com.stripe" % "stripe-java" % "1.15.1",
"com.amazonaws" % "aws-java-sdk" % "1.3.11",
javaCore,
javaJdbc,
javaEbean
)
val main = play.Project(appName, appVersion, appDependencies).settings(
// Add your own project settings here
)
}