Openshift provide a range of options for Java. My app needed Java 7 and Tomcat 7 (there currently doesn't seem to be an option for Java 8) so I selected the appropriate option and set about getting my app deployed.
$ git cloneA directory structure and pom file is already setup for those wanting to commit source code to be built by Openshift prior to deployment. This wasn't what I wanted as I've already compiled a war file and just want a quick way to deploy it. For this option, Red Hat have also put a 'webapps' folder in the root of the repository so I needed to do was delete the 'pom.xml' and the 'src' folder, add the war then push.
$ cd nutritionapp/
$ git rm pom.xmlI then ssh'd into OpenShift using the url provided in the web interface and did 'tail -f app-root/logs/jbossews.log' to see what was happening with deployment. There was a problem during start up but the log entry wasn't too helpful. Luckily I found a post here which helped out, seems that in OpenShift the 'web.xml' in the app needs to have the Log4jConfigListener removed.
$ git rm -r src/
$ git add webapps/nutritionapp-1.1.war
$ git commit -am "deploy v0.1 to cloud"
$ git push
So after a quick edit of the 'web.xml' one last commit was needed.
org.springframework.web.util.Log4jConfigListener
$ git commit -am "removing Log4jConfigListener"That was it, the whole process was pretty simple.
$ git push
No comments:
Post a Comment