61

我刚刚开始使用 Play Framework。我已经下载并安装了 play 并创建了一个示例 java 应用程序。当我尝试在应用程序目录中启动播放控制台时,它会挂在“正在加载项目定义”处。

PS C:\dev\play\javatest> play.bat
Getting org.scala-sbt sbt_2.9.1 0.11.3 ...
:: retrieving :: org.scala-sbt#boot-app
        confs: [default]
        37 artifacts copied, 0 already retrieved (7245kB/283ms)
[info] Loading project definition from C:\dev\play\myFirstApp\project

当我尝试运行 Scala 应用程序时,我收到一条关于它正在等待锁定的消息:

PS C:\dev\play\scalatest> play
[info] Loading project definition from C:\dev\play\test1\project
Waiting for lock on C:\lib\play\repository\.sbt.ivy.lock to be available...

运行 Windows 7、JDK 1.7.0_05 和 Play Framework 2.0.2。有任何想法吗?

4

3 回答 3

131

我刚刚在 Play 2 中亲身体验了这一点,结果发现它并没有真正挂起,它只是拉一个 maven 并下载 Internet。要验证这与您在编辑project/plugins.sbt和替换时遇到的行为相同:

logLevel := Level.Warn

logLevel := Level.Debug

(虽然我是在 OSX 上构建的,但我想你会在 Windows 上体验到类似的输出。)

于 2012-09-26T15:20:29.893 回答
2

只是在这里添加到现有答案,

从 Play 2.2x 升级到 Play 2.3.x 后,我也看到了这种行为(请参阅MigrationGuide

我正在调试如下。

在 Linux 上,转到您的项目文件夹,然后:

$ bash -x `which sbt`
.... OUTPUT SKIPPED....
++ ((  128 < 512  ))
++ local 'common_opts=-Xms1024m -Xmx1024m -XX:ReservedCodeCacheSize=128m'
++ [[ 1.7.0_55 < 1.8 ]]
++ local perm=256
++ echo '-Xms1024m -Xmx1024m -XX:ReservedCodeCacheSize=128m -XX:MaxPermSize=256m'
+ execRunner java -Xms1024m -Xmx1024m -XX:ReservedCodeCacheSize=128m -XX:MaxPermSize=256m -jar /usr/share/sbt-launcher-packaging/bin/sbt-launch.jar
+ [[ -n '' ]]
+ [[ -n '' ]]
+ java -Xms1024m -Xmx1024m -XX:ReservedCodeCacheSize=128m -XX:MaxPermSize=256m -jar /usr/share/sbt-launcher-packaging/bin/sbt-launch.jar

记下最后一行的命令,取消当前进程Ctrl+C,然后执行它添加-verbose选项java

java -verbose -Xms1024m -Xmx1024m -XX:ReservedCodeCacheSize=128m -XX:MaxPermSize=256m -jar /usr/share/sbt-launcher-packaging/bin/sbt-launch.jar

最后我也加logLevel := Level.Debug进去了project/plugins.sbt

但是,它不断给出这样的输出:

.... OUTPUT SKIPPED....
info]   [SUCCESSFUL ] org.apache.maven.doxia#doxia-sink-api;1.1!doxia-sink-api.jar (2065ms)
[debug]         tried http://repo.typesafe.com/typesafe/ivy-releases/org.apache.maven.doxia/doxia-logging-api/1.1/jars/doxia-logging-api.jar
[debug] CLIENT ERROR: Not Found url=http://repo.typesafe.com/typesafe/ivy-releases/org.apache.maven.doxia/doxia-logging-api/1.1/jars/doxia-logging-api.jar
[debug]         tried http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.apache.maven.doxia/doxia-logging-api/1.1/jars/doxia-logging-api.jar
[debug] CLIENT ERROR: Not Found url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.apache.maven.doxia/doxia-logging-api/1.1/jars/doxia-logging-api.jar
[debug]         tried /home/saleem/.ivy2/local/org.apache.maven.doxia/doxia-logging-api/1.1/jars/doxia-logging-api.jar
[debug]         tried http://repo1.maven.org/maven2/org/apache/maven/doxia/doxia-logging-api/1.1/doxia-logging-api-1.1.jar
[info] downloading http://repo1.maven.org/maven2/org/apache/maven/doxia/doxia-logging-api/1.1/doxia-logging-api-1.1.jar ...
[debug]     public: downloading http://repo1.maven.org/maven2/org/apache/maven/doxia/doxia-logging-api/1.1/doxia-logging-api-1.1.jar
[debug]     public: downloading http://repo1.maven.org/maven2/org/apache/maven/doxia/doxia-logging-api/1.1/doxia-logging-api-1.1.jar.sha1
[debug] sha1 OK for http://repo1.maven.org/maven2/org/apache/maven/doxia/doxia-logging-api/1.1/doxia-logging-api-1.1.jar
[info]  [SUCCESSFUL ] org.apache.maven.doxia#doxia-logging-api;1.1!doxia-logging-api.jar (3997ms)
[debug]         tried http://repo.typesafe.com/typesafe/ivy-releases/org.apache.maven/maven-plugin-registry/2.2.1/jars/maven-plugin-registry.jar
[debug] CLIENT ERROR: Not Found url=http://repo.typesafe.com/typesafe/ivy-releases/org.apache.maven/maven-plugin-registry/2.2.1/jars/maven-plugin-registry.jar
[debug]         tried http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.apache.maven/maven-plugin-registry/2.2.1/jars/maven-plugin-registry.jar
[debug] CLIENT ERROR: Not Found url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.apache.maven/maven-plugin-registry/2.2.1/jars/maven-plugin-registry.jar
[debug]         tried /home/saleem/.ivy2/local/org.apache.maven/maven-plugin-registry/2.2.1/jars/maven-plugin-registry.jar
[debug]         tried http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-registry/2.2.1/maven-plugin-registry-2.2.1.jar
[info] downloading http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-registry/2.2.1/maven-plugin-registry-2.2.1.jar ...
[debug]     public: downloading http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-registry/2.2.1/maven-plugin-registry-2.2.1.jar
[debug]     public: downloading http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-registry/2.2.1/maven-plugin-registry-2.2.1.jar.sha1
[debug] sha1 OK for http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-registry/2.2.1/maven-plugin-registry-2.2.1.jar
[info]  [SUCCESSFUL ] org.apache.maven#maven-plugin-registry;2.2.1!maven-plugin-registry.jar (2025ms)
[debug]         tried http://repo.typesafe.com/typesafe/ivy-releases/backport-util-concurrent/backport-util-concurrent/3.1/jars/backport-util-concurrent.jar
[debug] CLIENT ERROR: Not Found url=http://repo.typesafe.com/typesafe/ivy-releases/backport-util-concurrent/backport-util-concurrent/3.1/jars/backport-util-concurrent.jar
[debug]         tried http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/backport-util-concurrent/backport-util-concurrent/3.1/jars/backport-util-concurrent.jar
[debug] CLIENT ERROR: Not Found url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/backport-util-concurrent/backport-util-concurrent/3.1/jars/backport-util-concurrent.jar
[debug]         tried /home/saleem/.ivy2/local/backport-util-concurrent/backport-util-concurrent/3.1/jars/backport-util-concurrent.jar
[debug]         tried http://repo1.maven.org/maven2/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
[info] downloading http://repo1.maven.org/maven2/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar ...
[debug]     public: downloading http://repo1.maven.org/maven2/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
.... OUTPUT SKIPPED....

似乎有太多 jar 需要下载。我现在正在使用 Typesafe Activator 的离线版本(在此处下载 356MB ,这要快得多!

于 2014-07-24T15:58:58.927 回答
0

尝试中止您的构建,删除引用的锁定文件,然后再次执行“播放运行”。

于 2014-01-21T15:09:59.343 回答