Play框架在启动时挂起:“从项目定义加载”
我刚刚开始使用Play Framework。 我已经下载并安装播放,并创build了一个示例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应用程序时,我收到一条关于它等待locking的消息:
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。 有任何想法吗?
我只是用Play 2亲自体验过这个游戏,事实certificate它并没有真正的悬挂,只是拉着一个maven并下载了互联网。 要validation这是你遇到编辑project/plugins.sbt
相同的行为,并replace:
logLevel := Level.Warn
同
logLevel := Level.Debug
(虽然我在OSX上构build,但我想象你会在Windows上经历类似的输出。)
只要在这里添加现有的答案,
从Play 2.2x升级到Play 2.3.x后,我也看到了这种行为(请参阅MigrationGuide )
我正在debugging如下。
在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
最后我还在project/plugins.sbt
添加了logLevel := Level.Debug
。
但是,它一直在给这样的输出:
.... 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 在这里下载),而且速度非常快!
尝试放弃构build,删除引用的locking文件,然后再次执行“播放运行”。