将默认的Play 2.0 Java应用程序部署到cloudfoundry时出现502错误

时间:2012-07-11 17:26:30

标签: cloudfoundry

我无法让我的播放应用程序在cloudfoundry.com上运行。我尝试使用Play 2.0.2生成的最简单的Java应用程序。当我访问mysampleplay.cloudfoundry.com时,我收到nginx错误:502 Bad Gateway。

我没有报告崩溃和vcm日志说我的服务正在运行。有什么建议吗?

这些是我输入的说明:

C:\javadev\prj\play>play new sample
       _            _
 _ __ | | __ _ _  _| |
| '_ \| |/ _' | || |_|
|  __/|_|\____|\__ (_)
|_|            |__/

play! 2.0.2, http://www.playframework.org

The new application will be created in C:\javadev\prj\play\sample

    What is the application name?
> sample

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 sample is created.

Have fun!


C:\javadev\prj\play>cd sample

C:\javadev\prj\play\sample>ls
README   app      conf     project  public

C:\javadev\prj\play\sample>play clean dist
[info] Loading project definition from C:\javadev\prj\play\sample\project
[info] Set current project to sample (in build file:/C:/javadev/prj/play/sample/
)
[success] Total time: 0 s, completed 11-jul-2012 19:05:55
[info] Updating {file:/C:/javadev/prj/play/sample/}sample...
[info] Resolving org.hibernate.javax.persistence#hibernate-jpa-2.0-api;1.0.1.Fin

[info] Done updating.
[info] Compiling 4 Scala sources and 2 Java sources to C:\javadev\prj\play\sample\target\scala-2.9.1\classes...
[info] Packaging C:\javadev\prj\play\sample\target\scala-2.9.1\sample_2.9.1-1.0-
SNAPSHOT.jar ...
[info] Done packaging.

Your application is ready in C:\javadev\prj\play\sample\dist\sample-1.0-SNAPSHOT
.zip

[success] Total time: 5 s, completed 11-jul-2012 19:06:00

C:\javadev\prj\play\sample>vmc push --path=dist\sample-1.0-SNAPSHOT.zip
Application Name: mysampleplay
    Detected a Play Framework Application, is this correct? [Yn]: y
Application Deployed URL [mysampleplay.cloudfoundry.com]:
Memory reservation (128M, 256M, 512M, 1G, 2G) [256M]:
How many instances? [1]: 1
Bind existing services to 'mysampleplay'? [yN]: n
Create services to bind to 'mysampleplay'? [yN]: n
Would you like to save this configuration? [yN]: y
Manifest written to manifest.yml.
Creating Application: OK
Uploading Application:
  Checking for available resources: OK
  Processing resources: OK
  Packing application: OK
  Uploading (66K): OK
Push Status: OK

Staging Application 'mysampleplay': OK

Starting Application 'mysampleplay': OK


C:\javadev\prj\play\sample>vmc logs mysampleplay
====> /logs/stdout.log <====

No database found in Play configuration.  Skipping auto-reconfiguration.
Play server process ID is 31827
[←[33mwarn←[0m] play - Plugin [org.cloudfoundry.reconfiguration.play.JPAPlugin]
is disabled
[←[37minfo←[0m] play - Application started (Prod)
[←[37minfo←[0m] play - Listening for HTTP on port 24712...

1 个答案:

答案 0 :(得分:1)

我们与cloudfoundry支持一起找到了原因。我的类是用Java 7u5编译的,所以你必须明确指定运行时

vmc push --path = dist / application.zip --runtime java7