我添加了一个新的openshift应用程序。我按照说明操作并通过git push上传了我的代码。
上传日志似乎很好:
1)创建了ROOT.war:
remote: [INFO] Packaging webapp
remote: [INFO] Assembling webapp [opinion] in [/var/lib/openshift/542ee542e0b8cd
2ca700037d/app-root/runtime/repo/target/opinion]
remote: [INFO] Processing war project
remote: [INFO] Copying webapp resources [/var/lib/openshift/542ee542e0b8cd2ca700
037d/app-root/runtime/repo/src/main/webapp]
remote: [INFO] Webapp assembled in [108 msecs]
remote: [INFO] Building war: /var/lib/openshift/542ee542e0b8cd2ca700037d/app-roo
t/runtime/repo/webapps/ROOT.war
remote: [INFO] WEB-INF/web.xml already added, skipping
remote: [INFO] -----------------------------------------------------------------
-------
remote: [INFO] BUILD SUCCESS
remote: [INFO] -----------------------------------------------------------------
-------
remote: [INFO] Total time: 1:24.196s
remote: [INFO] Finished at: Fri Oct 03 14:11:18 EDT 2014
remote: [INFO] Final Memory: 9M/91M
remote: [INFO] -----------------------------------------------------------------
2)部署成功
remote: + rm -rf /var/lib/openshift/542ee542e0b8cd2ca700037d/jbossews//work/
remote: ++ ls /var/lib/openshift/542ee542e0b8cd2ca700037d/app-root/runtime/repo/
/webapps
remote: + '[' 'META-INF
remote: ROOT.war
remote: WEB-INF
remote: css
remote: fonts
remote: img
remote: js' ']'
remote: + rsync -rS --delete /var/lib/openshift/542ee542e0b8cd2ca700037d/app-roo
t/runtime/repo//webapps/ /var/lib/openshift/542ee542e0b8cd2ca700037d/jbossews//w
ebapps/
remote: + hot_deploy_enabled_for_latest_deployment
remote: ++ ruby_sdk latest_deployment_metadata.hot_deploy
remote: ++ oo-ruby -I/usr/lib/openshift/cartridge_sdk -rruby/sdk -e 'include Ope
nShift::CartridgeSdk; puts latest_deployment_metadata.hot_deploy'
remote: + enabled=false
remote: + '[' false == true ']'
remote: + return 1
remote: Starting jbossews cartridge
remote: Found 127.4.212.129:8080 listening port
remote: -------------------------
remote: Git Post-Receive Result: success
remote: Activation status: success
remote: Deployment completed with status: success
To ssh://542ee542e0b8cd2ca700037d@opinion-expertviews.rhcloud.com/~/git/opinion.
git/
e2a907c..08d3a44 master -> master
然而,当我点击网址(http://opinion-expertviews.rhcloud.com)时,我仍然看到了 "欢迎使用OpenShift上的JBossEWS(Apache / Tomcat)应用程序"屏
我错过了什么?
解决:
我上传的文件不正确。更正方式:
我将项目编译成war文件,将其放入webapps 在openshift git目录的根目录下的文件夹。
删除了pom.xml
文件将更新的文件夹推送到我的应用程序
现在提供申请:
非常感谢你的帮助并指导我,虽然我错过了这些点是愚蠢的
答案 0 :(得分:2)
由于您使用ROOT.war以外的名称部署war文件,因此您需要在与您部署的war文件名相同的上下文中访问您的应用程序。例如,如果您的war文件名为myapplication.war,您的网址为http://app-domain.rhcloud.com/myapplication,要解决此问题,您可以重命名您的war文件ROOT.war,您的应用程序将在http://app-domain.rhcloud.com/ < / p>