应用程序在引导期间崩溃

时间:2015-12-07 09:48:21

标签: maven cloudfoundry swisscomdev

我正在尝试使用cf-mvn-plugin将应用程序部署到基于云基础架构的基础架构。

应用程序(在本地运行没有任何问题)会立即崩溃。虽然引导日志看起来几乎就像在我的本地机器上,但唯一不同的是我得到这样的消息:

2015-12-07 10:39:04 [App/0] OUT 2015-12-07 09:39:04,691 INFO org.springframework.web.context.support.XmlWebApplicationContext - Bean 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0' of type [class org.springframework.transaction.annotation.AnnotationTransactionAttributeSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

然后在bootstrap期间的某个时间,应用程序崩溃:

2015-12-07 10:42:41 [DEA/18] ERR Instance (index 0) failed to start accepting connections
2015-12-07 10:42:41 [API/0] OUT App instance exited with guid 405d6d18-d730-4765-a98b-7f5986f87eb2 payload: {"cc_partition"=>"default", "droplet"=>"405d6d18-d730-4765-a98b-7f5986f87eb2", "version"=>"6023f58c-9165-4a6d-8403-2727ec9f3723", "instance"=>"2118978ed1f54f18a03b1d77f82f3b58", "index"=>0, "reason"=>"CRASHED", "exit_status"=>255, "exit_description"=>"failed to accept connections within health check timeout", "crash_timestamp"=>1449481361}
2015-12-07 10:42:41 [API/3] OUT App instance exited with guid 405d6d18-d730-4765-a98b-7f5986f87eb2 payload: {"cc_partition"=>"default", "droplet"=>"405d6d18-d730-4765-a98b-7f5986f87eb2", "version"=>"6023f58c-9165-4a6d-8403-2727ec9f3723", "instance"=>"2118978ed1f54f18a03b1d77f82f3b58", "index"=>0, "reason"=>"CRASHED", "exit_status"=>255, "exit_description"=>"failed to accept connections within health check timeout", "crash_timestamp"=>1449481361}

这是我当前的cf-maven-plugin配置:

<plugin>
                <groupId>org.cloudfoundry</groupId>
                <artifactId>cf-maven-plugin</artifactId>
                <version>1.1.2</version>
                <configuration>
                    <server>${cloudfoundry.server}</server>
                    <target>${cloudfoundry.target}</target>
                    <org>${cloudfoundry.org}</org>
                    <space>${cloudfoundry.space}</space>
                    <memory>1024</memory>
                    <appname>myApp</appname>
                    <url>my-app.scapp.io</url>
                    <healthCheckTimeout>180</healthCheckTimeout>
                    <appStartupTimeout>10</appStartupTimeout>
                    <env>
                        <JAVA_OPTS>-Djavax.xml.accessExternalSchema=all -Djava.security.egd=file:///dev/urandom</JAVA_OPTS>
                    </env>
                    <services>
                        <service>
                            <name>datadb</name>
                            <label>${cloudfoundry.service.datadb.label}</label>
                            <plan>${cloudfoundry.service.datadb.plan}</plan>
                        </service>
                    </services>
                </configuration>
            </plugin>

CLI-Version:6.14.0 + 2654a47-2015-11-18

cf-mvn-plugin version:1.1.2

谢谢!

1 个答案:

答案 0 :(得分:0)

当应用程序部署到CF时,平台将在启动时检查应用程序的运行状况,并希望它在一定时间后运行。在您的情况下,您已将此运行状况检查超时配置为180秒(<healthCheckTimeout>180</healthCheckTimeout>)。这是平台支持的最大超时时间。

由于您已为应用分配了路由(使用<url>haufe-demo.scapp.io</url>),因此平台将访问该网址并期望在3分钟超时期限内收到回复。如果应用程序不是Web应用程序并且不响应HTTP请求,则应该在没有路由的情况下部署它。在app中没有路由,平台运行状况检查只是确保PID处于活动状态。

[DEA/18] ERR Instance (index 0) failed to start accepting connections错误表示您的应用在3分钟超时窗口内未接受HTTP连接。