无法在 OpenShift 上部署我的应用程序:"Failed to execute: 'control deploy' for /var/lib/openshift/XXX/jbossews"

Cannot deploy my application on OpenShift: "Failed to execute: 'control deploy' for /var/lib/openshift/XXX/jbossews"

将新更改推送到我的 OpenShift 存储库时,应用程序构建良好但无法部署:

Repository ssh://XXX@myapp-mydomain.rhcloud.com/~/git/app.git/

The jbossews cartridge is already stopped
Stopping MongoDB cartridge
Stopping RockMongo cartridge
Waiting for stop to finish
Waiting for stop to finish
Building git ref 'master', commit 9a591e1
Using Maven mirror /var/lib/openshift/XXX/app-root/runtime/repo//.openshift/config/settings.rhcloud.xml
Apache Maven 3.0.4 (r1232336; 2012-12-18 14:36:37-0500)
Maven home: /usr/share/java/apache-maven-3.0.4
Java version: 1.7.0_85, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.85/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "2.6.32-504.34.1.el6.x86_64", arch: "i386", family: "unix"
Found pom.xml... attempting to build with 'mvn --global-settings /var/lib/openshift/XXX/app-root/runtime/repo//.openshift/config/settings.rhcloud.xml clean package -Popenshift -DskipTests'
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building myapp 1.0.0
[INFO] ------------------------------------------------------------------------
...
... downloading lot of Maven dependencies
...
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 20 source files to /var/lib/openshift/XXX/app-root/runtime/repo/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ myapp ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ myapp ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ myapp ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-war-plugin:2.6:war (default-war) @ myapp ---
...
... downloading lot of Maven dependencies
...
[INFO] Packaging webapp
[INFO] Assembling webapp [myapp] in [/var/lib/openshift/XXX/app-root/runtime/repo/target/myapp-1.0.0]
[INFO] Processing war project
[INFO] Copying webapp webResources [/var/lib/openshift/XXX/app-root/runtime/repo/src/main/webapp] to [/var/lib/openshift/XXX/app-root/runtime/repo/target/myapp-1.0.0]
[INFO] Copying webapp webResources [/var/lib/openshift/XXX/app-root/runtime/repo/src/main/webapp] to [/var/lib/openshift/XXX/app-root/runtime/repo/target/myapp-1.0.0]
[INFO] Copying webapp resources [/var/lib/openshift/XXX/app-root/runtime/repo/src/main/webapp]
[INFO] Webapp assembled in [4153 msecs]
[INFO] Building war: /var/lib/openshift/XXX/app-root/runtime/repo/webapps/ROOT.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:03.312s
[INFO] Finished at: Sun Oct 04 13:23:39 EDT 2015
[INFO] Final Memory: 24M/160M
[INFO] ------------------------------------------------------------------------
Preparing build for deployment
Deployment id is 686f0e29
Activating deployment
Starting MongoDB cartridge
Waiting for mongo to start...
Starting RockMongo cartridge
rm: cannot remove `/var/lib/openshift/XXX/jbossews//conf/web.xml': No such file or directory
-------------------------
Git Post-Receive Result: failure
Activation status: failure
Activation failed for the following gears:
XXX (Error activating gear: CLIENT_ERROR: Failed to execute: 'control deploy' for /var/lib/openshift/XXX/jbossews
#<IO:0x00000001230388>
#<IO:0x00000001230310>
)
Deployment completed with status: failure
postreceive failed

知道发生了什么吗?

我已经用你提到的所有墨盒创建了一个应用程序,一切正常。但是有一点不同:我的 web.xml 配置文件在其他地方,在 src/main/webapp/WEB-INF/web.xml。我敢打赌,无论你在哪里调用它,你都有错误的路径,如你所见:

rm: cannot remove `/var/lib/openshift/XXX/jbossews//conf/web.xml': No such file or directory

仅供参考,通常,当您收到错误 Failed to execute: 'control deploy' 时,这意味着部署过程中出现了错误并停止了,因此该错误消息不是实际错误。

我手动创建了一个空文件/var/lib/openshift/XXX/jbossews/conf/web.xml,这解决了问题:rm命令成功结束,部署成功。