2015-10-24 57 views
2

我想部署一個遊戲框架(Java)的應用程序(V 2.4)在Heroku上,但是當我EXCUTE命令git push heroku master我得到以下異常:錯誤部署播放框架2.4在Heroku

remote:  [warn] :::::::::::::::::::::::::::::::::::::::::::::: 
remote:  [warn] ::   UNRESOLVED DEPENDENCIES   :: 
remote:  [warn] :::::::::::::::::::::::::::::::::::::::::::::: 
remote:  [warn] :: com.typesafe.sbtrc#client-2-11;0.3.1: not found 
remote:  [warn] :: com.typesafe.sbtrc#actor-client-2-11;0.3.1: not found 
remote:  [warn] :::::::::::::::::::::::::::::::::::::::::::::: 
remote:  [warn] 
remote:  [warn] Note: Unresolved dependencies path: 
remote:  [warn]   com.typesafe.sbtrc:client-2-11:0.3.1 
remote:  [warn]    +- com.typesafe.play:fork-run-protocol_2.11:2.4.3 ((play.sbt.forkrun.PlayForkRun) PlayForkRun.scala#L48) 
remote:  [warn]    +- com.typesafe.play:fork-run_2.11:2.4.3 ((play.sbt.forkrun.PlayForkRun) PlayForkRun.scala#L48) 
remote:  [warn]    +- escarbajo:escarbajo_2.11:1.0-SNAPSHOT 
remote:  [warn]   com.typesafe.sbtrc:actor-client-2-11:0.3.1 
remote:  [warn]    +- com.typesafe.play:fork-run_2.11:2.4.3 ((play.sbt.forkrun.PlayForkRun) PlayForkRun.scala#L48) 
remote:  [warn]    +- escarbajo:escarbajo_2.11:1.0-SNAPSHOT 
remote:  sbt.ResolveException: unresolved dependency: com.typesafe.sbtrc#client-2-11;0.3.1: not found 
remote:  unresolved dependency: com.typesafe.sbtrc#actor-client-2-11;0.3.1: not found 
remote:   at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:291) 
remote:   at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:188) 
remote:   at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:165) 
remote:   at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:155) 
remote:   at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:155) 
remote:   at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:132) 
remote:   at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:57) 
remote:   at sbt.IvySbt$$anon$4.call(Ivy.scala:65) 
remote:   at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93) 
remote:   at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:78) 
remote:   at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:97) 
remote:   at xsbt.boot.Using$.withResource(Using.scala:10) 
remote:   at xsbt.boot.Using$.apply(Using.scala:9) 
remote:   at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58) 
remote:   at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:48) 
remote:   at xsbt.boot.Locks$.apply0(Locks.scala:31) 
remote:   at xsbt.boot.Locks$.apply(Locks.scala:28) 
remote:   at sbt.IvySbt.withDefaultLogger(Ivy.scala:65) 
remote:   at sbt.IvySbt.withIvy(Ivy.scala:127) 
remote:   at sbt.IvySbt.withIvy(Ivy.scala:124) 
remote:   at sbt.IvySbt$Module.withModule(Ivy.scala:155) 
remote:   at sbt.IvyActions$.updateEither(IvyActions.scala:165) 
remote:   at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1369) 
remote:   at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1365) 
remote:   at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$87.apply(Defaults.scala:1399) 
remote:   at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$87.apply(Defaults.scala:1397) 
remote:   at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:37) 
remote:   at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1402) 
remote:   at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1396) 
remote:   at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:60) 
remote:   at sbt.Classpaths$.cachedUpdate(Defaults.scala:1419) 
remote:   at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1348) 
remote:   at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1310) 
remote:   at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47) 
remote:   at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40) 
remote:   at sbt.std.Transform$$anon$4.work(System.scala:63) 
remote:   at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226) 
remote:   at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226) 
remote:   at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17) 
remote:   at sbt.Execute.work(Execute.scala:235) 
remote:   at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226) 
remote:   at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226) 
remote:   at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159) 
remote:   at sbt.CompletionService$$anon$2.call(CompletionService.scala:28) 
remote:   at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
remote:   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
remote:   at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
remote:   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
remote:   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
remote:   at java.lang.Thread.run(Thread.java:745) 
remote:  [error] (*:update) sbt.ResolveException: unresolved dependency: com.typesafe.sbtrc#client-2-11;0.3.1: not found 
remote:  [error] unresolved dependency: com.typesafe.sbtrc#actor-client-2-11;0.3.1: not found 
remote:  [error] Total time: 20 s, completed Oct 24, 2015 9:02:27 PM 
remote: 
remote: !  ERROR: Failed to run sbt! 
remote:  We're sorry this build is failing. If you can't find the issue in application 
remote:  code, please submit a ticket so we can help: https://help.heroku.com 
remote:  You can also try reverting to the previous version of the buildpack by running: 
remote:  $ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-scala#previous-version 
remote: 
remote:  Thanks, 
remote:  Heroku 
remote: 
remote: 
remote: !  Push rejected, failed to compile Play 2.x - Java app 
remote: 
remote: Verifying deploy... 
remote: 
remote: !  Push rejected to protected-lowlands-4290. 
remote: 
To https://git.heroku.com/protected-lowlands-4290.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to 'https://git.heroku.com/protected-lowlands-4290.git' 

我已經全面搜索解決方案,我發現了一些適用於其他方面的東西,但在這種情況下它並沒有奏效。我已經試過如下:

  1. project/play-fork-run.sbt添加到.gitignore文件。
  2. 刪除文件play-fork-run.sbt
  3. 這些解析程序添加到build.stb文件: resolvers += Resolver.url("Typesafe Ivy", url(" http://repo.typesafe.com/typesafe/ivy-snapshots "))(Resolver.ivyStylePatterns) resolvers += "Typesafe" at " http://repo.typesafe.com/typesafe/releases/ "

但似乎沒有任何工作,當我編譯和運行在本地主機上的應用程序,它完美的作品。

任何想法來解決這個問題?

任何幫助,非常感謝!

感謝

回答

2

這個工程對本地主機的原因是,你可能在某些時候,它下載有問題的依賴到本地緩存.ivy2運行activator。但是在Heorku上,只有sbt運行,並且激活器中有一個主要錯誤,這個錯誤在很長時間內沒有被修復,導致激活器和sbt之間的不同解析器。

這聽起來像你已經遇到這些報告,其中包含一些建議(主要是你已經嘗試過):

底層問題是這樣的依賴性:

addSbtPlugin("com.typesafe.play" % "sbt-fork-run-plugin" % "2.4.3") 

仔細檢查所有的SBT文件project/下,確保這種依賴性是不以任何人。在推送到Heroku之前,請確保您的Git存儲庫更改已經提交。

最後,如果你仍然卡住,你可以切換到使用sbt-heroku plugin,它使用本地編譯的資產並將它們部署到Heroku。這將一起避免這個問題。

此外,我建議你在Play mailing list上提出這個問題。這是一個長期存在的問題,我遇到了很多遇到過它的人。 Typesafe的人們需要聽取他們的用戶關於這是多麼的猖獗。

+0

謝謝!我使用了sbt-heroku插件,它工作正常! – hank8617

1

對於Play的應用,確保符合下列條件:

  1. 刪除<project root folder>/project/play-fork-run.sbt
  2. 刪除<project root folder>/project/sbt-ui.sbt
  3. <project root folder>/build.sbt除非明確希望它有刪除fork in run := true

另外:請確保文件play-fork-run.sbtsbt-ui.sbt在你.gitignore並沒有被檢查到項目中。

如上所述,如果你繼續看問題,刪除線:

addSbtPlugin("com.typesafe.play" % "sbt-fork-run-plugin" % "x.x.x")

addSbtPlugin("org.scala-sbt" % "sbt-core-next" % "x.x.x")

從所有項目中的插件引用。這些插件僅支持Activator UI,並且沒有爲常規構建提供有用的功能。