在heroku上部署Play2.1-RC1会出错

时间:2012-11-21 17:15:33

标签: scala heroku playframework-2.0 scala-2.10 playframework-2.1

我将基于Play2.1-RC1的应用程序部署到Heroku时遇到此错误

[info] 'compiler-interface' not yet compiled for Scala 2.10.0-RC1. Compiling...
       sbt appears to be exiting abnormally.
         The log file for this session is at /tmp/sbt6398446576215517800.log
       java.lang.OutOfMemoryError: PermGen space
        at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
        at java.util.concurrent.FutureTask.get(FutureTask.java:111)
        at sbt.ConcurrentRestrictions$$anon$4.take(ConcurrentRestrictions.scala:195)
        at sbt.Execute.next$1(Execute.scala:85)
        at sbt.Execute.processAll(Execute.scala:88)
        ...

            ...
     Error during sbt execution: java.lang.OutOfMemoryError: PermGen space  !  
     Failed to build app with sbt  !     
     Heroku push rejected, failed to compile Play 2.0 - scala app

build.properties

sbt.version=0.12.1

plugins.sbt文件

// Comment to get more information during initialization
logLevel := Level.Warn

// The Typesafe repository 
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"


// Use the Play sbt plugin for Play projects
addSbtPlugin("play" % "sbt-plugin" % "2.1-RC1")

Build.scala

导入sbt._ 导入PlayProject ._

object ApplicationBuild extends Build {

  val appName = "myappname"
  val appVersion = "1.0-SNAPSHOT"

  val appDependencies = Seq(
    // Add your project dependencies here,
    jdbc,filters,
    "org.squeryl" % "squeryl_2.10.0-RC2" % "0.9.5-4",
    "postgresql" % "postgresql" % "9.1-901-1.jdbc4"
  )

  val main = play.Project(appName, appVersion, appDependencies).settings(
    // Add your own project settings here
  )

}

更新 改变了JAVA_OPTS和SBT_OPTS  -Xmx384m -Xss512k -XX:+UseCompressedOops 至  -Xmx1024m -Xss512k -XX:+UseCompressedOops

但同样的错误。

1 个答案:

答案 0 :(得分:3)

这是一个PermGen错误,请尝试添加:

-XX:PermSize=256m

这是一个已知问题,请查看https://github.com/heroku/heroku-buildpack-scala/pull/26https://github.com/heroku/heroku-buildpack-scala/tree/perm-gen

<强>更新

正如@ryanbrainard指出的那样,perm-gen问题已在默认的scala-buildpack上解决,因此不需要使用上面提到的特定buildpack。