将play 2.2.0 app部署到heroku时出错

时间:2013-10-22 10:19:59

标签: heroku playframework-2.2

我正在尝试从play 2.2.0框架部署java计算机数据库示例。我在项目的根目录中执行的步骤:

  1. git init
  2. git add。
  3. git commit -m“init”
  4. heroku create
  5. git push heroku master
  6. 在第5步之后,应用程序部署到heroku并尝试启动,但失败并且不清楚java.lang.NullPointerException。以下是构建日志的最后几行:

    [SUCCESSFUL ] org.fusesource.jansi#jansi;1.4!jansi.jar (363ms)
    
    :: retrieving :: org.scala-sbt#boot-scala
    
    confs: [default]
    
    5 artifacts copied, 0 already retrieved (24390kB/38ms)
    
    [warn] The global sbt directory is now versioned and is located at /tmp/build_77392410-f294-4b8e-bce9-b1fab69ca175/.sbt_home/.sbt/0.13.
    
    [warn]   You are seeing this warning because there is global configuration in /tmp/build_77392410-f294-4b8e-bce9-b1fab69ca175/.sbt_home/.sbt but not in /tmp/build_77392410-f294-4b8e-bce9-b1fab69ca175/.sbt_home/.sbt/0.13.
    
    [warn]   The global sbt directory may be changed via the sbt.global.base system property.
    
    [error] java.lang.NullPointerException
    
    [error] Use 'last' for the full log.
    
    Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?  !     Failed to build app with sbt
    
    !     Push rejected, failed to compile Play 2.x - Java app
    
    To git@heroku.com:nameless-ravine-2560.git
    ! [remote rejected] master -> master (pre-receive hook declined)
    
    error: failed to push some refs to 'git@heroku.com:nameless-ravine-2560.git'
    

    然后我尝试了同样的游戏2.1.2并得到了另一个错误:

               [info] Compiling 1 Scala source to /tmp/build_a41bb3e2-97a2-4da4-b4ad-7ccefadfa094/.sbt_home/.sbt/plugins/target/scala-2.9.2/sbt-0.12/classes...
           [info] Loading project definition from /tmp/build_a41bb3e2-97a2-4da4-b4ad-7ccefadfa094/project
           [warn]   module not found: play#sbt-plugin;2.0
           [warn] ==== typesafe-ivy-releases: tried
           [warn]   http://repo.typesafe.com/typesafe/ivy-releases/play/sbt-plugin/scala_2.9.2/sbt_0.12/2.0/ivys/ivy.xml
           [warn] ==== sbt-plugin-releases: tried
           [warn]   http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/play/sbt-plugin/scala_2.9.2/sbt_0.12/2.0/ivys/ivy.xml
           [warn] ==== local: tried
           [warn]   /tmp/build_a41bb3e2-97a2-4da4-b4ad-7ccefadfa094/.sbt_home/.ivy2/local/play/sbt-plugin/scala_2.9.2/sbt_0.12/2.0/ivys/ivy.xml
           [warn] ==== Typesafe repository: tried
           [warn]   http://repo.typesafe.com/typesafe/releases/play/sbt-plugin_2.9.2_0.12/2.0/sbt-plugin-2.0.pom
           [warn] ==== heroku-sbt-typesafe: tried
           [warn] ==== heroku-central: tried
           [warn]   http://s3pository.heroku.com/maven-central/play/sbt-plugin_2.9.2_0.12/2.0/sbt-plugin-2.0.pom
           [warn] ==== typesafe: tried
           [warn]   http://repo.typesafe.com/typesafe/repo/play/sbt-plugin_2.9.2_0.12/2.0/sbt-plugin-2.0.pom
           [warn]   ::::::::::::::::::::::::::::::::::::::::::::::
           [warn]   ::          UNRESOLVED DEPENDENCIES         ::
           [warn]   ::::::::::::::::::::::::::::::::::::::::::::::
           [warn]   :: play#sbt-plugin;2.0: not found
           [warn]   ::::::::::::::::::::::::::::::::::::::::::::::
           [warn]
           [warn]   Note: Some unresolved dependencies have extra attributes.  Check that these dependencies exist with the requested attributes.
           [warn]           play:sbt-plugin:2.0 (sbtVersion=0.12, scalaVersion=2.9.2)
           [warn]
           sbt.ResolveException: unresolved dependency: play#sbt-plugin;2.0: not found
            at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:214)
            at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:122)
            at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:121)
            at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:114)
            at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:114)
            at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:102)
            at sbt.IvySbt.liftedTree1$1(Ivy.scala:49)
            at sbt.IvySbt.action$1(Ivy.scala:49)
            at sbt.IvySbt$$anon$3.call(Ivy.scala:58)
            at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:98)
            at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:81)
            at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:102)
            at xsbt.boot.Using$.withResource(Using.scala:11)
            at xsbt.boot.Using$.apply(Using.scala:10)
            at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:62)
            at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:52)
            at xsbt.boot.Locks$.apply0(Locks.scala:31)
            at xsbt.boot.Locks$.apply(Locks.scala:28)
            at sbt.IvySbt.withDefaultLogger(Ivy.scala:58)
            at sbt.IvySbt.withIvy(Ivy.scala:99)
            at sbt.IvySbt.withIvy(Ivy.scala:95)
            at sbt.IvySbt$Module.withModule(Ivy.scala:114)
            at sbt.IvyActions$.update(IvyActions.scala:121)
            at sbt.Classpaths$$anonfun$work$1$1.apply(Defaults.scala:951)
            at sbt.Classpaths$$anonfun$work$1$1.apply(Defaults.scala:949)
            at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$54.apply(Defaults.scala:972)
            at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$54.apply(Defaults.scala:970)
            at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:35)
            at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:974)
            at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:969)
            at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:45)
            at sbt.Classpaths$.cachedUpdate(Defaults.scala:977)
            at sbt.Classpaths$$anonfun$45.apply(Defaults.scala:856)
            at sbt.Classpaths$$anonfun$45.apply(Defaults.scala:853)
            at sbt.Scoped$$anonfun$hf10$1.apply(Structure.scala:586)
            at sbt.Scoped$$anonfun$hf10$1.apply(Structure.scala:586)
            at scala.Function1$$anonfun$compose$1.apply(Function1.scala:49)
            at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$12.apply(Structure.scala:311)
            at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$12.apply(Structure.scala:311)
            at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:41)
            at sbt.std.Transform$$anon$5.work(System.scala:71)
            at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:232)
            at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:232)
            at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
            at sbt.Execute.work(Execute.scala:238)
            at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:232)
            at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:232)
            at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
            at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
            at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
            at java.util.concurrent.FutureTask.run(FutureTask.java:166)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
            at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
            at java.util.concurrent.FutureTask.run(FutureTask.java:166)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
            at java.lang.Thread.run(Thread.java:679)
           [error] (*:update) sbt.ResolveException: unresolved dependency: play#sbt-plugin;2.0: not found
           Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?  !     Failed to build app with sbt
    
     !     Push rejected, failed to compile Play 2.x - Java app
    
    To git@heroku.com:obscure-cove-6170.git
     ! [remote rejected] master -> master (pre-receive hook declined)
    error: failed to push some refs to 'git@heroku.com:obscure-cove-6170.git'
    

1 个答案:

答案 0 :(得分:5)

我在这里找到了解决方案Java Play 2 - Compile error -> Heroku

我已经把

addSbtPlugin("play" % "sbt-plugin" % "2.2.0")

而不是默认

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % System.getProperty("play.version"))

虽然现在有另一个运行时错误,但这是另一个故事......