我正在按照CloudFoundry 博客上的说明部署一个简单的 Play 应用程序。我选择了“创建一个简单的 Java 应用程序”选项:
Simons-MacBook-Pro:tmp simonmacdonald$ play new helloworld-java
_ _
_ __ | | __ _ _ _| |
| '_ \| |/ _' | || |_|
| __/|_|\____|\__ (_)
|_| |__/
play! 2.0.4, http://www.playframework.org
The new application will be created in /Users/simonmacdonald/Work/tmp/helloworld-java
What is the application name?
> helloworld-java
Which template do you want to use for this new application?
1 - Create a simple Scala application
2 - Create a simple Java application
3 - Create an empty project
> 2
OK, application helloworld-java is created.
Have fun!
然后我就可以验证该应用程序在本地计算机上是否正常工作。下一步是构建发行版:
Simons-MacBook-Pro:helloworld-java simonmacdonald$ play dist
[info] Loading project definition from /Users/simonmacdonald/Work/tmp/helloworld-java/project
[info] Set current project to helloworld-java (in build file:/Users/simonmacdonald/Work/tmp/helloworld-java/)
[info] Packaging /Users/simonmacdonald/Work/tmp/helloworld-java/target/scala-2.9.1/helloworld-java_2.9.1-1.0-SNAPSHOT.jar ...
[info] Done packaging.
Your application is ready in /Users/simonmacdonald/Work/tmp/helloworld-java/dist/helloworld-java-1.0-SNAPSHOT.zip
[success] Total time: 2 s, completed 1-Feb-2013 4:35:48 PM
看起来它成功了。然后我做我的目标和登录使用:
vmc target api.cloudfoundry.com
vmc login
接下来,我将应用程序推送到服务器:
Simons-MacBook-Pro:helloworld-java simonmacdonald$ vmc push --path=dist/helloworld-java-1.0-SNAPSHOT.zip
Name> helloworld-java
Instances> 1
1: play
2: other
Framework> 1
1: java
2: java7
3: other
Runtime> 1
1: 64M
2: 128M
3: 256M
4: 512M
Memory Limit> 256M
Creating helloworld-java... OK
1: helloworld-java.cloudfoundry.com
2: none
URL> helloworld-java.cloudfoundry.com
Updating helloworld-java... OK
Create services for application?> n
Bind other services to application?> n
Save configuration?> y
Saving to manifest.yml... OK
Uploading helloworld-java... OK
Using manifest file manifest.yml
Starting helloworld-java... OK
Checking helloworld-java... GAVE UP
Application failed to start.
如您所见,该应用程序无法启动。当我检查状态为 0% 并尝试检索日志时会导致 vmc 崩溃。有人有想法么?